Knowledge Base

INFO: Creating DIB Brushes With DIB_PAL_COLORS

Article ID: 186585

Article Last Modified on 2/22/2007


APPLIES TO


This article was previously published under Q186585

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

Keywords: kbinfo KB186585