CreateBrushIndirect

  HBRUSH CreateBrushIndirect(lplb)    
  LPLOGBRUSH lplb;    

The CreateBrushIndirect function creates a logical brush that has the style, color, and pattern given in the structure at which lplb points.

Parameters

lplb

Points to a LOGBRUSH structure that contains information about the brush. The LOGBRUSH structure has the following format:

typedef struct tagLOGBRUSH { /* lb */

UINT lbStyle;

COLORREF lbColor;

LONG lbHatch;

} LOGBRUSH;

Return Value

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

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

A brush created using a monochrome (one plane, one 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, and pixels represented by a bit set to 1 will be drawn with the current background color.

See Also

DeleteObject, GetBrushOrgEx, LOGBRUSH, SelectObject, SetBrushOrgEx