Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

LOGBRUSH structure

The LOGBRUSH structure defines the style, color, and pattern of a physical brush. It is used by the CreateBrushIndirect and ExtCreatePen functions.

Syntax


typedef struct tagLOGBRUSH {
  UINT      lbStyle;
  COLORREF  lbColor;
  ULONG_PTR lbHatch;
} LOGBRUSH, *PLOGBRUSH;

Members

lbStyle

The brush style. The lbStyle member must be one of the following styles.

ValueMeaning
BS_DIBPATTERNA pattern brush defined by a device-independent bitmap (DIB) specification. If lbStyle is BS_DIBPATTERN, the lbHatch member contains a handle to a packed DIB. For more information, see discussion in lbHatch.
BS_DIBPATTERN8X8See BS_DIBPATTERN.
BS_DIBPATTERNPTA pattern brush defined by a device-independent bitmap (DIB) specification. If lbStyle is BS_DIBPATTERNPT, the lbHatch member contains a pointer to a packed DIB. For more information, see discussion in lbHatch.
BS_HATCHEDHatched brush.
BS_HOLLOWHollow brush.
BS_NULLSame as BS_HOLLOW.
BS_PATTERNPattern brush defined by a memory bitmap.
BS_PATTERN8X8See BS_PATTERN.
BS_SOLIDSolid brush.

 

lbColor

The color in which the brush is to be drawn. If lbStyle is the BS_HOLLOW or BS_PATTERN style, lbColor is ignored.

If lbStyle is BS_DIBPATTERN or BS_DIBPATTERNPT, the low-order word of lbColor specifies whether the bmiColors members of the BITMAPINFO structure contain explicit red, green, blue (RGB) values or indexes into the currently realized logical palette. The lbColor member must be one of the following values.

ValueMeaning
DIB_PAL_COLORSThe color table consists of an array of 16-bit indexes into the currently realized logical palette.
DIB_RGB_COLORSThe color table contains literal RGB values.

 

If lbStyle is BS_HATCHED or BS_SOLID, lbColor is a COLORREF color value. To create a COLORREF color value, use the RGB macro.

lbHatch

A hatch style. The meaning depends on the brush style defined by lbStyle.

If lbStyle is BS_DIBPATTERN, the lbHatch member contains a handle to a packed DIB. To obtain this handle, an application calls the GlobalAlloc function with GMEM_MOVEABLE (or LocalAlloc with LMEM_MOVEABLE) to allocate a block of memory and then fills the memory with the packed DIB. A packed DIB consists of a BITMAPINFO structure immediately followed by the array of bytes that define the pixels of the bitmap.

If lbStyle is BS_DIBPATTERNPT, the lbHatch member contains a pointer to a packed DIB. The pointer derives from the memory block created by LocalAlloc with LMEM_FIXED set or by GlobalAlloc with GMEM_FIXED set, or it is the pointer returned by a call like LocalLock (handle_to_the_dib). A packed DIB consists of a BITMAPINFO structure immediately followed by the array of bytes that define the pixels of the bitmap.

If lbStyle is BS_HATCHED, the lbHatch member specifies the orientation of the lines used to create the hatch. It can be one of the following values.

ValueMeaning
HS_BDIAGONALA 45-degree upward, left-to-right hatch
HS_CROSSHorizontal and vertical cross-hatch
HS_DIAGCROSS45-degree crosshatch
HS_FDIAGONALA 45-degree downward, left-to-right hatch
HS_HORIZONTALHorizontal hatch
HS_VERTICALVertical hatch

 

If lbStyle is BS_PATTERN, lbHatch is a handle to the bitmap that defines the pattern. The bitmap cannot be a DIB section bitmap, which is created by the CreateDIBSection function.

If lbStyle is BS_SOLID or BS_HOLLOW, lbHatch is ignored.

Remarks

Although lbColor controls the foreground color of a hatch brush, the SetBkMode and SetBkColor functions control the background color.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Wingdi.h (include Windows.h)

See also

Brushes Overview
Brush Structures
BITMAPINFO
CreateBrushIndirect
CreateDIBSection
ExtCreatePen
LOGBRUSH32
SetBkColor
SetBkMode
COLORREF
RGB

 

 

Community Additions

Show:
© 2014 Microsoft