Colourmap functionality is incomplete, and will be extended in the future. Currently, colourmaps may be returned from some wxWindows libraries that load bitmaps (e.g. wxImage, DIB). To display a bitmap, its colourmap should normally be set for that window.
There are some strict rules for colourmap useage. A colourmap should never be deleted before being deselected from a window or device context (although it may be used for several windows and device contexts simultaneously). So, call wxDC::SetColourMap with a NULL argument to make sure that its original (probably system) colourmap is restored.
If you are relying on wxWindows to clean up your bitmaps on program exit, then you must be extra vigilant about cleaning up colourmaps before bitmaps (and windows) are deleted. So it may not be an option to use global objects, where you cannot be sure of the order that C++ destroys objects; use dynamically created and destroyed objects instead.
wxColourMap::wxColourMap
wxColourMap::~wxColourMap
wxColourMap::Create
void wxColourMap(void)
Constructor.
void ~wxColourMap(void)
Destructor.
If you have to delete the colourmap (for example, you are creating a lot of them), then call wxDC::SetColourMap with a NULL argument to ensure that the old colourmap is restored, and the current colourmap is selected out of the device context.
Bool Create(const int n, const char *red,
const char *green, const char *blue)
Creates a colourmap from arrays of size n, one for each red, blue or green component. Implemented only under Windows.