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.

EXTLOGPEN structure

The EXTLOGPEN structure defines the pen style, width, and brush attributes for an extended pen. This structure is used by the GetObject function when it retrieves a description of a pen that was created when an application called the ExtCreatePen function.

Syntax


typedef struct tagEXTLOGPEN {
  DWORD     elpPenStyle;
  DWORD     elpWidth;
  UINT      elpBrushStyle;
  COLORREF  elpColor;
  ULONG_PTR elpHatch;
  DWORD     elpNumEntries;
  DWORD     elpStyleEntry[1];
} EXTLOGPEN, *PEXTLOGPEN;

Members

elpPenStyle

A combination of pen type, style, end cap style, and join style. The values from each category can be retrieved by using a bitwise AND operator with the appropriate mask.

The elpPenStyle member masked with PS_TYPE_MASK has one of the following pen type values.

ValueMeaning
PS_GEOMETRICThe pen is geometric.
PS_COSMETICThe pen is cosmetic.

 

The elpPenStyle member masked with PS_STYLE_MASK has one of the following pen styles values:

ValueMeaning
PS_DASHThe pen is dashed.
PS_DASHDOTThe pen has alternating dashes and dots.
PS_DASHDOTDOTThe pen has alternating dashes and double dots.
PS_DOTThe pen is dotted.
PS_INSIDEFRAMEThe pen is solid. When this pen is used in any GDI drawing function that takes a bounding rectangle, the dimensions of the figure are shrunk so that it fits entirely in the bounding rectangle, taking into account the width of the pen. This applies only to PS_GEOMETRIC pens.
PS_NULLThe pen is invisible.
PS_SOLIDThe pen is solid.
PS_USERSTYLEThe pen uses a styling array supplied by the user.

 

The following category applies only to PS_GEOMETRIC pens. The elpPenStyle member masked with PS_ENDCAP_MASK has one of the following end cap values.

ValueMeaning
PS_ENDCAP_FLATLine end caps are flat.
PS_ENDCAP_ROUNDLine end caps are round.
PS_ENDCAP_SQUARELine end caps are square.

 

The following category applies only to PS_GEOMETRIC pens. The elpPenStyle member masked with PS_JOIN_MASK has one of the following join values.

ValueMeaning
PS_JOIN_BEVELLine joins are beveled.
PS_JOIN_MITERLine joins are mitered when they are within the current limit set by the SetMiterLimit function. A join is beveled when it would exceed the limit.
PS_JOIN_ROUNDLine joins are round.

 

elpWidth

The width of the pen. If the elpPenStyle member is PS_GEOMETRIC, this value is the width of the line in logical units. Otherwise, the lines are cosmetic and this value is 1, which indicates a line with a width of one pixel.

elpBrushStyle

The brush style of the pen. The elpBrushStyle member value can be one of the following.

ValueMeaning
BS_DIBPATTERNSpecifies a pattern brush defined by a DIB specification. If elpBrushStyle is BS_DIBPATTERN, the elpHatch member contains a handle to a packed DIB. For more information, see discussion in elpHatch
BS_DIBPATTERNPTSpecifies a pattern brush defined by a DIB specification. If elpBrushStyle is BS_DIBPATTERNPT, the elpHatch member contains a pointer to a packed DIB. For more information, see discussion in elpHatch.
BS_HATCHEDSpecifies a hatched brush.
BS_HOLLOWSpecifies a hollow or NULL brush.
BS_PATTERNSpecifies a pattern brush defined by a memory bitmap.
BS_SOLIDSpecifies a solid brush.

 

elpColor

If elpBrushStyle is BS_SOLID or BS_HATCHED, elpColor specifies the color in which the pen is to be drawn. For BS_HATCHED, the SetBkMode and SetBkColor functions determine the background color.

If elpBrushStyle is BS_HOLLOW or BS_PATTERN, elpColor is ignored.

If elpBrushStyle is BS_DIBPATTERN or BS_DIBPATTERNPT, the low-order word of elpColor specifies whether the bmiColors member of the BITMAPINFO structure contain explicit RGB values or indices into the currently realized logical palette. The elpColor value must be one of the following.

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

 

The RGB macro is used to generate a COLORREF structure.

elpHatch

If elpBrushStyle is BS_PATTERN, elpHatch is a handle to the bitmap that defines the pattern.

If elpBrushStyle is BS_SOLID or BS_HOLLOW, elpHatch is ignored.

If elpBrushStyle is BS_DIBPATTERN, the elpHatch member is 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 elpBrushStyle is BS_DIBPATTERNPT, the elpHatch member is 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 elpBrushStyle is BS_HATCHED, the elpHatch member specifies the orientation of the lines used to create the hatch. It can be one of the following values.

ValueMeaning
HS_BDIAGONAL45-degree upward hatch (left to right)
HS_CROSSHorizontal and vertical crosshatch
HS_DIAGCROSS45-degree crosshatch
HS_FDIAGONAL45-degree downward hatch (left to right)
HS_HORIZONTALHorizontal hatch
HS_VERTICALVertical hatch

 

elpNumEntries

The number of entries in the style array in the elpStyleEntry member. This value is zero if elpPenStyle does not specify PS_USERSTYLE.

elpStyleEntry

A user-supplied style array. The array is specified with a finite length, but it is used as if it repeated indefinitely. The first entry in the array specifies the length of the first dash. The second entry specifies the length of the first gap. Thereafter, lengths of dashes and gaps alternate.

If elpWidth specifies geometric lines, the lengths are in logical units. Otherwise, the lines are cosmetic and lengths are in device units.

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

Pens Overview
Pen Structures
BITMAPINFO
COLORREF
ExtCreatePen
GetObject
RGB
SetBkColor
SetBkMode

 

 

Show: