typedef struct tagLOGBRUSH { /* lb */
UINT lbStyle;
COLORREF lbColor;
LONG lbHatch;
} LOGBRUSH;
The LOGBRUSH structure defines the style, color, and pattern of a physical brush. It is used by the the CreateBrushIndirect and ExtCreatePen functions.
lbStyle
Specifies the brush style. The lbStyle field can be any one of the following styles:
Value | Meaning |
BS_DIBPATTERN | Specifies a pattern brush defined by a device-independent bitmap (DIB) specification. |
BS_HATCHED | Specifies a hatched brush. |
BS_HOLLOW | Specifies a hollow brush. |
BS_NULL | Same as BS_HOLLOW. |
BS_PATTERN | Specifies a pattern brush defined by a memory bitmap. |
BS_SOLID | Specifies a solid brush. |
lbColor
Specifies the color in which the brush is to be drawn. If lbStyle is BS_HOLLOW or BS_PATTERN, lbColor is ignored.
If lpStyle is BS_DIBPATTERN, the low-order word of lbColor specifies whether the bmiColors members of the BITMAPINFO data structure contain explicit RGB values or indexes into the currently realized logical palette. The lbColor member must be one of the following values:
Value | Meaning |
DIB_PAL_COLORS | The color table consists of an array of 16-bit indexes into the currently realized logical palette. |
DIB_RGB_COLORS | The color table contains literal RGB values. |
lbHatch
Specifies a hatch style. The meaning depends on the brush style.
If lbStyle is BS_DIBPATTERN, the lbHatch member contains a handle to a packed DIB.
If lbStyle is BS_HATCHED, the lbHatch member specifies the orientation of the lines used to create the hatch. It can be any one of the following values:
Value | Meaning |
HS_BDIAGONAL | 45-degree upward hatch (left to right) |
HS_CROSS | Horizontal and vertical cross-hatch |
HS_DIAGCROSS | 45-degree crosshatch |
HS_FDIAGONAL | 45-degree downward hatch (left to right) |
HS_HORIZONTAL | Horizontal hatch |
HS_VERTICAL | Vertical hatch |
If lbStyle is BS_PATTERN, lbHatch must be a handle to the bitmap that defines the pattern.
If lbStyle is BS_SOLID or BS_HOLLOW, lbHatch is ignored.
While lbColor controls the foreground color of a hatch brush, the SetBkMode and SetBkColor functions control the background color.
CreateBrushIndirect, ExtCreatePen SetBkColor, SetBkMode