CreateDIBPatternBrushPt

  HBRUSH CreateDIBPatternBrushPt(lpPackedDIB, iUsage)    
  LPVOID lpPackedDIB; /* address of BITMAPINFO struct and bitmap bits */
  DWORD iUsage; /* usage flags */

The CreateDIBPatternBrushPt function creates a logical brush that has the pattern specified by the device-independent bitmap (DIB) which is defined by the lpPackedDIB parameter.

Parameters

lpPackedDIB

Pointer to a packed DIB. A packed DIB consists of a BITMAPINFO data structure immediately followed by the array of bytes which define the pixels of the bitmap. The BITMAPINFO structure has the following format:

typedef struct tagBITMAPINFO { /* bmi */

BITMAPINFOHEADER bmiHeader;

RGBQUAD bmiColors[1];

} BITMAPINFO;

iUsage

Specifies whether the bmiColors member of the BITMAPINFO data structure contains a valid color table and if so, whether the entries in this color table contain explicit RGB values or palette indices.

The iUsage parameter must be one of the following values:

Value Meaning

DIB_PAL_COLORS The color table is provided and consists of an array of 16-bit indices into the logical palette of the DC into which the brush will be selected.
DIB_RGB_COLORS The color table is provided and contains literal RGB values.
DIB_PAL_INDICES No color table is provided. The bitmap itself contains indices into the logical palette of the DC into which the brush will be selected.

Return Value

The return value identifies a logical brush if the function is successful. Otherwise, it is NULL.

Comments

A brush is an 8-pixel by 8-pixel bitmap that Windows uses to paint the interior of filled objects.

Once an application has created a brush by calling CreateDIBPatternBrushPt, it can select that brush into any device context by calling the SelectObject function.

See Also

CreateSolidBrush, CreateHatchBrush, CreatePatternBrush, CreateSolidBrush, CreateDIBPatternBrush, DeleteObject, GetBrushOrgEx, SelectObject, SetBrushOrgEx