
this function indicates the total number of palette entries that were
replaced.
DIBs are often used to enhance and decorate a user interface. T make youro
Matching interface
interface consistent with your application user’ system, you should use thes
colors to system
MapUIColors function, which replaces standard interface colors with the
colors
user’ own system colors. Here is the syntax for MapUIColors:s
void MapUIColors(UINT mapColors, TColor* bkColor = 0);
The mapColors parameter should be an OR’ed combination of five flags:
TDib::MapFace, TDib::MapT xt, TDib::MapShadow, TDib::MapHighlight, ande
TDib::MapFrame. Each of these values causes a different color substitution
to take place:
__________________________________________________________________________
This flag Replaces… With…
____________________________________________________________________
TDib::MapT xt TColor::Black
COLOR_BTNTEXT
e
TDib::MapFace TColor::LtGray
COLOR_BTNFA EC
TDib::MapFace TColor::Gray
COLOR_BTNSHADOW
TDib::MapFace TColor::White
COLOR_BTNHIGHLIGHT
TDib::MapFrame TColor::LtMagenta
COLOR_WINDOWFRAME
____________________________________________________________________
The bkColor parameter if specified, causes the color TColor::LtY llow to be, e
replaced by the color bkColor.
Because MapUIColors searches for and replaces TColor table entries, this
function is useful only with a DIB in RGB mode. Furthermore, because it
replaces particular colors, you must design your interface using the
standard system colors; for example, your button text should be black
(TColor::Black), button faces should be light gray (TColor::LtGray), and so on.
This should be fairly simple, since these are specifically designed so that
they are equivalent to the standard default colors for each interface
element.
Y u should also call the MapUIColors function before you modify any of theo
colors modified by MapUIColors. If you don’t do this, MapUIColors won’t be
able to find the attribute color for which it is searching, and that part of the
interface won’t match the system colors.
TDib provides a number of protected functions that are accessible only
Extending TDib
from within TDib and TDib-derived classes. Y u can also access TDib’o s
control data:
■ Info is a pointer to a BITMAPINFO or BITMAPCOREINFO structure,
which contains the attributes, color table, and other information about
the DIB.
Chapter 13, Graphics objects
325