INFO: Creating DIB Brushes With DIB_PAL_COLORS

ID: Q186585

The information in this article applies to:

SUMMARY

When you use CreateBrushIndirect(), CreateDIBPatternBrush(), or CreateDIBPatternBrushPt() to create a device-independent bitmap (DIB) pattern brush with DIB_PAL_COLORS specified for the color usage, the Graphics Device Interface (GDI) uses the color indices in the bmiColors field in the BITMAPINFO structure to populate the color table of the DIB. GDI resolves the indices to the RGB values from the palette selected into the device context where the brush is selected.

This mapping is performed only once when the brush is selected. Subsequent use of the brush yields results based on the initial mapping because the DIBs color table contains the resolved RGB values rather than the original palette indices.

Additional query words: kbAPI kbBitmap kbGDI kbDSupport kbDSD

Platform          : winnt
Issue type        : kbinfo

Last Reviewed: June 1, 1998