CBrush::CreateBrushIndirect

Syntax

BOOL CreateBrushIndirect( LPLOGBRUSH lpLogBrush );

Parameters

lpLogBrush

Points to a LOGBRUSH structure that contains information about the brush.

The LOGBRUSH structure has the following form:

typedef struct tagLOGBRUSH {

WORD lbStyle;

COLORREF lbColor;

short int lbHatch;

} LOGBRUSH;

Remarks

Initializes a brush with a style, color, and pattern specified in a LOGBRUSH structure. The brush can subsequently be selected as the current brush for any device context.

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

Return Value

TRUE if the function is successful; otherwise FALSE.

See Also

CBrush::CreateDIBPatternBrush, CBrush::CreatePatternBrush, CBrush::CreateSolidBrush, CBrush::CreateHatchBrush, CGdiObject::CreateStockObject, ::CreateBrushIndirect