Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

CreateBrushIndirect function

The CreateBrushIndirect function creates a logical brush that has the specified style, color, and pattern.

Syntax


HBRUSH CreateBrushIndirect(
  _In_ const LOGBRUSH *lplb
);

Parameters

lplb [in]

A pointer to a LOGBRUSH structure that contains information about the brush.

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 CreateBrushIndirect, it can select it into any device context by calling the SelectObject function.

A brush created by using a monochrome bitmap (one color plane, one bit per pixel) is drawn using the current text and background colors. Pixels represented by a bit set to 0 are drawn with the current text color; pixels represented by a bit set to 1 are drawn with the current background color.

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
DeleteObject
GetBrushOrgEx
LOGBRUSH
SelectObject
SetBrushOrgEx

 

 

Community Additions

ADD
Show:
© 2015 Microsoft