WTBitmap::mapColorToBitmap() is not the easiest function to understand because it
does not yield any visual results on its own. Instead, it sets up
references from one image to another which in turn can be copied into a third
image. The first image shown is our source image. The second image
is our color map. Our third image is a copy of the second image - it is
our destination image. Once the source image is mapped onto the color map
image with
WTBitmap::mapColorToBitmap() we can call image3.copyRect (image2, 2); specifying the type
"2" parameter which will copy image2 respecting what is mapped in the
color map.
WT::designedForVersion() must be called and 2.0 functionality enabled
in order to use the copyRect() function.
WTBitmap::mapColorToBitmap() does not modify any images; it only sets references up
between an image and another image with a certain color.
All images must be loaded before calling WTBitmap::mapColorToBitmap()
or mapping may
fail.
WTBitmap::mapColorToBitmap() can have as many colors mapped as you
wish. They will all take effect simultaneously when copyRect() is called.
WTBitmap::copyRect() must be called with a "2" as it's second parameter to
take advantage of the color mapping. Without specifying the type, a
normal WTBitmap::copyRect() will occur, just copying the color map image instead of the
image mapped to the color map image.