LOGBRUSH

Logical-Brush Attribute Information

The LOGBRUSH structure defines the style, color, and pattern of a physical brush to be created by using the CreateBrushIndirect function.

typedef struct tagLOGBRUSH {

WORD lbStyle;

COLORREF lbColor;

short int lbHatch;

} LOGBRUSH;

The LOGBRUSH structure has the following fields:

Field Description  
lbStyle Specifies the brush style. The lbStyle field can be any one of the following styles:  
  Style 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_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 fields of the BITMAPINFO data structure contain explicit RGB values or indexes into the currently realized logical palette. The lbColor field 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 field contains a handle to a packed DIB. To obtain this handle, an application calls the GlobalAlloc function to allocate a block of global memory and then fills the memory with the packed DIB. A packed DIB consists of a BITMAPINFO data structure immediately followed by the array of bytes which define the pixels of the bitmap.  
  If lbStyle is BS_HATCHED, the lbHatch field 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 crosshatch
  Value Meaning
  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.  

See Also

The CreateBrushIndirect function in Chapter 4, “Functions Directory.”