CreateDIBPatternBrushPt function

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

Syntax


HBRUSH CreateDIBPatternBrushPt(
  _In_ const VOID *lpPackedDIB,
  _In_       UINT iUsage
);

Parameters

lpPackedDIB [in]

A pointer to a packed DIB consisting of a BITMAPINFO structure immediately followed by an array of bytes defining the pixels of the bitmap.

iUsage [in]

Specifies whether the bmiColors member of the BITMAPINFO structure contains a valid color table and, if so, whether the entries in this color table contain explicit red, green, blue (RGB) values or palette indexes. The iUsage parameter must be one of the following values.

ValueMeaning
DIB_PAL_COLORS

A color table is provided and consists of an array of 16-bit indexes into the logical palette of the device context into which the brush is to be selected.

DIB_RGB_COLORS

A color table is provided and contains literal RGB values.

 

Return value

If the function succeeds, the return value identifies a logical brush.

If the function fails, the return value is NULL.

Remarks

A brush is a bitmap that the system uses to paint the interiors of filled shapes.

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

When you no longer need the brush, call the DeleteObject function to delete it.

ICM: No color is done at brush creation. However, color management is performed when the brush is selected into an ICM-enabled device context.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Wingdi.h (include Windows.h)

Library

Gdi32.lib

DLL

Gdi32.dll

See also

Brushes Overview
Brush Functions
BITMAPINFO
CreateDIBPatternBrush
CreateHatchBrush
CreatePatternBrush
CreateSolidBrush
DeleteObject
GetBrushOrgEx
SelectObject
SetBrushOrgEx

 

 

Show: