Export (0) Print
Expand All

2.2.20 LogPenEx Object

The LogPenEx object specifies the style, width, and color of an extended logical pen.


0

1

2

3

4

5

6

7

8

9
1
0

1

2

3

4

5

6

7

8

9
2
0

1

2

3

4

5

6

7

8

9
3
0

1

PenStyle

Width

BrushStyle

ColorRef

BrushHatch

NumStyleEntries

StyleEntry (variable)

...

PenStyle (4 bytes): A 32-bit unsigned integer that specifies the pen style. This value MUST be defined from the PenStyle enumeration (section 2.1.25).

T A pen style is a combination of pen type, line style, line cap, and line join.

Width (4 bytes): A 32-bit unsigned integer that specifies the width of the line drawn by the pen.

If the pen type in the PenStyle field is PS_GEOMETRIC, this value is the width in logical units; otherwise, the width is specified in device units. If the pen type in the PenStyle field is PS_COSMETIC, this value MUST be 0x00000001.

BrushStyle (4 bytes): A 32-bit unsigned integer that specifies a brush style for the pen from the WMFBrushStyle enumeration ([MS-WMF] section 2.1.1.4).

If the pen type in the PenStyle field is PS_GEOMETRIC, this value MUST be either BS_SOLID or BS_HATCHED. The value of this field can be BS_NULL, but only if the line style specified in PenStyle is PS_NULL. The BS_NULL style SHOULD be used to specify a brush that has no effect.<62>

ColorRef (4 bytes): A WMF ColorRef object ([MS-WMF] section 2.2.2.8). The interpretation of this field depends on the BrushStyle value, as shown in the table later in this section.

BrushHatch (4 bytes): The brush hatch pattern. The definition of this field depends on the BrushStyle value, as shown in the table later in this section.

NumStyleEntries (4 bytes): The number of elements in the array specified in the StyleEntry field. This value SHOULD be zero if PenStyle does not specify PS_USERSTYLE.

StyleEntry (variable): An optional array of 32-bit unsigned integers that defines the lengths of dashes and gaps in the line drawn by this pen, when the value of PenStyle is PS_USERSTYLE line style for the pen. The array contains a number of entries specified by NumStyleEntries, 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 the pen type in the PenStyle field is PS_GEOMETRIC, the lengths are specified in logical units; otherwise, the lengths are specified in device units.

The LogPenEx object includes the specification of brush attributes, so it can be used to draw lines that consist of custom or predefined patterns. The following table shows the relationship between the BrushStyle, ColorRef, and BrushHatch fields in a LogPenEx object. Only supported brush styles are listed.

BrushStyle

ColorRef

BrushHatch

BS_SOLID

SHOULD be a WMF ColorRef (section 2.2.2.8) object ([MS-WMF]), which specifies the color of lines drawn by the pen.

Not used, and SHOULD be ignored.

BS_NULL

Not used, and SHOULD be ignored.

Not used, and SHOULD be ignored.

BS_HATCHED

SHOULD be a WMF ColorRef (section 2.2.2.8) object, which specifies the foreground color of the hatch pattern.

SHOULD be a value from the EMFHatchStyle (section 2.1.17) enumeration that specifies the orientation of lines used to create the hatch. If PS_GEOMETRIC is not set in the PenStyle field, this field MUST be either HS_SOLIDTEXTCLR (0x0008) or HS_SOLIDBKCLR (0x000A).

BS_PATTERN

The low-order word SHOULD be a value from the WMF ColorUsage (section 2.1.1.6) enumeration ([MS-WMF] section 2.1.1.6).

Not used, and SHOULD be ignored. The brush pattern is specified by a packed DIB ([MS-WMF] section 2.2.2.9).

BS_DIBPATTERN

The low-order word SHOULD be a value from the WMF ColorUsage enumeration.

Not used, and SHOULD be ignored. The brush pattern is specified by a packed DIB.

BS_DIBPATTERNPT

The low-order word SHOULD be a value from the WMF ColorUsage (section 2.1.1.6) enumeration.

Not used, and SHOULD be ignored. The brush pattern is specified by a packed DIB.

 
Show:
© 2014 Microsoft