ImageGear for C and C++ on Windows v19.3 - Updated
IG_GUI_palette_window_create
API Reference Guide > Core Component API Reference > Core Component Functions Reference > GUI Functions > GUI Palette Functions > IG_GUI_palette_window_create

This function creates a GUI palette window.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_GUI_palette_window_create (
        HIGEAR hIGear, 
        DWORD dwGrpID, 
        HWND hWndParent, 
        const LPSTR lpcszTitle, 
        INT nX, 
        INT nY, 
        INT nWidth, 
        INT nHeight, 
        HWND FAR lphWndPalette 
);

Arguments:

Name Type Description
hIGear HIGEAR HIGEAR handle of image.
dwGrpID DWORD Identifier of group where to get display options for creating palette.
hWndParent HWND Handle of Parent window.
lpszTitle const LPSTR Title of Palette window.
nX INT X position of upper left corner of window.
nY INT Y position of upper left corner of window.
nWidth INT Width of window.
nHeight INT Height of window.
lphWndPalette HWND FAR Far pointer to HWND object to hold Palette window handle.

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:

Palette Edit, Display

Example:

 
Copy Code
HIGEAR hIGear;  /* Global HIGEAR handle of image in parent window  */
HWND hWndParent; /* Global Windows window handle of that window  */
HWND hWndPalette;/* Global HIGEAR handle of Palette window       */
AT_ERRCOUNT nErrcount; /* Returned count of errors         */
 ...
/* Create a Palette window for image hIGear's palette:                */
nErrcount = IG_GUI_palette_window_create ( hIGear, IG_GRP_DEFAULT, hWndParent, "I.G. Pal
Window", 50, 50, 200, 200, &hWndPalette );

Remarks:

ImageGear automatically displays the image's palette in the palette window, and the user may edit the palette. Also call function IG_GUI_palette_CB_register() if you want to be informed any time the user is actually trying to modify the palette.