ImageGear for C and C++ on Windows v19.10 - Updated
IG_dspl_palette_create
API Reference Guide > Core Component API Reference > Core Component Functions Reference > Display Functions > IG_dspl_palette_create

This function calculates all the display parameters, the way IG_dspl_image_draw() does, and produces the same palette that IG_dspl_image_draw realizes before drawing onto hDC; it returns DevicePalette if it is not set with a custom value.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_dspl_palette_create(
        [IN] HIGEAR hIGear,
        [IN] DWORD dwGrpID,
        [IN] HWND hWnd,
        [IN] HDC hDC,
        [OUT] HPALETTE FAR* lphPalette
);

Arguments:

Name Type Description
hIGear HIGEAR ImageGear handle of image.
DwGrpID DWORD Identifier of group containing the palette options to use.
HWnd HWND Handle of window where the image is drawn.
HDC HDC Handle of device context on which to draw.
LphPalette HPALETTE FAR* Pointer to where the palette handle should be returned.

Return Value:

Returns the number of ImageGear errors that occurred during this function call.

Supported Raster Image Formats:

All pixel formats supported by ImageGear for C and C++.

Sample:

Medical, MFC

Example:

 
Copy Code
HIGEAR           hIGear;      /* HIGEAR handle of image  */ 
DWORD           nGrpID;      /* display group identifier */
HPALETTE                hPalette;     /* handle of palette  */
 ...
IG_dspl_palette_create( hIGear, nGrpID, hWnd, hDC, &hPalette );
 ...