7.1 About color
The depth of a bitmap determines which pixel values you can use to draw on the bitmap. The valid pixel values for a bitmap of depth depth are in the range between 0 and
)). Any system color map entry is a valid pixel value for a bitmap of the same depth as the system display. For monochrome bitmaps, the only valid pixel values are 0 and 1. For a bitmap of depth 8, valid pixel values are between 0 and 255 inclusive. Each bitmap has default foreground and background pixel values that are used during graphic and text operations if you do not specify a color.
bitblt supports mapping between bitmaps of any depth. When there are an unequal number of planes in the destination bitmap and the source bitmap, you must specify how pixels in the source bitmap are translated into valid pixels for the destination bitmap.
For example, to convert a depth 8 bitmap into a depth 1 bitmap, you must specify a pixel map to translate depth 8 pixel values to depth 1 pixel values. The pixel map should be an array of 256 elements; that is, the array should contain an element for every possible pixel value in the depth 8 bitmap. The value of each element should be either 0 or 1, which are the possible pixel values for a depth 1 bitmap.
Viewports and windows can display bitmaps on the screen only when the bitmaps are the same depth as the system display or are of depth 1. On color displays, when a viewport or window has a bitmap of depth 1, it also has foreground and background colors that specify how the monochrome-to-color mapping should occur. You can change the values of these foreground and background colors.
The title of a monochrome or default color window is inverted from the default foreground and background colors of the window. The text of the title is the same color as the background, or white if a monochrome monitor is used. The bar appears in the foreground color, or in black if a monochrome monitor is used.
Generated with Harlequin WebMaker