typedef struct tagLOGBRUSH { /* lb */
UINT lbStyle;
COLORREF lbColor;
int lbHatch;
} LOGBRUSH;
The LOGBRUSH structure defines the style, color, and pattern of a physical brush to be created by using the CreateBrushIndirect function.
lbStyle
Specifies the brush style. This member can be one of the following values:
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_PATTERN | Specifies a pattern brush defined by a memory bitmap. |
BS_NULL | Equivalent to BS_HOLLOW. |
BS_SOLID | Specifies a solid brush. |
lbColor
Specifies the color in which the brush is to be drawn. If the lbStyle member is the BS_HOLLOW or BS_PATTERN value, lbColor is ignored.
If lpStyle is the BS_DIBPATTERN value, the low-order word of lbColor specifies whether the bmiColors members of the BITMAPINFO 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 | Color table consists of an array of 16-bit indexes into the currently realized logical palette. |
DIB_RGB_COLORS | Color table contains literal RGB values. |
lbHatch
Specifies a hatch style. The meaning depends on the brush style.
If the lbStyle member is the BS_DIBPATTERN style, the lbHatch member contains a handle to a packed DIB. To obtain this handle, an application calls the GlobalAlloc function to allocate a global memory object and then fills the memory with the packed DIB. A packed DIB consists of a BITMAPINFO structure immediately followed by the array of bytes which define the pixels of the bitmap.
If the lbStyle member is the BS_HATCHED style, the lbHatch member specifies the orientation of the lines used to create the hatch. This member can be 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 cross-hatch |
HS_FDIAGONAL | 45-degree downward hatch (left to right) |
HS_HORIZONTAL | Horizontal hatch |
HS_VERTICAL | Vertical hatch |
If the lbStyle member is the BS_PATTERN style, lbHatch must be a handle to the bitmap that defines the pattern.
If the lbStyle member is the BS_SOLID or the BS_HOLLOW style, lbHatch is ignored.
BITMAPINFO, CreateBrushIndirect, CreateBrushIndirect, GlobalAlloc