ImageGear for C and C++ on Windows v20.5 - Updated
Palette Window
User Guide > How to Work with ... > Common Operations > Viewing > GUI Features > GUI Windows > Palette Window

GUI Palette support provides a convenient way to permit a user to edit a palette by making mouse selections without requiring your application to make calls to the IG_palette_ ...() functions in order to update the palette. You create a GUI palette window by making a call to IG_GUI_palette_window_create(), and ImageGear creates the window, displays your named HIGEAR image's palette in it, and tracks the mouse as the user makes selections to modify the palette.

Any time the user makes an edit, your LPFNIG_GUIPALETTE callback function is called, if you've declared one by calling IG_GUI_palette_CB_register(). Your callback function is passed arguments telling which palette entry the user tried to change, and what the new RGB color is. Your function will return TRUE or FALSE to tell ImageGear to go ahead with the change, or deny the attempt. If TRUE, ImageGear modifies the image's DIB palette and reflects the color change in the palette window display as well.

Your application can call IG_GUI_palette_update() to update (refresh) the palette window, if your application has changed the image's palette while the palette window is on the screen.

When you are done using a palette window, your application can issue a Windows DestroyWindow() call to remove the palette window.

Is this page helpful?
Yes No
Thanks for your feedback.