//SETPENEX, style, thickness {r, g, b}
SETPENEX selects a "pen" (line thickness and style) for subsequent line drawing operations—e.g. LINETO and RECTANGLE. SETPENEX is an EXtended version of, and supersedes, the original SETPEN.
Parameters
style
Select one from each of the sections shown in the table. Also see Comments, below.
Symbol |
Value |
Description |
PS_SOLID |
0 |
Solid pen |
PS_DASH |
1 |
------- |
PS_DOT |
2 |
....... |
PS_DASHDOT |
3 |
_._._. |
PS_DASHDOTDOT |
4 |
_.._.._ |
|
|
|
PS_ENDCAP_ROUND |
0 |
Round endcaps (default) |
PS_ENDCAP_SQUARE |
&h0100 |
Square endcaps |
PS_ENDCAP_FLAT |
&h0200 |
Flat endcaps |
|
|
|
PS_JOIN_ROUND |
0 |
Round joins (default) |
PS_JOIN_BEVEL |
&h1000 |
Bevel joins |
PS_JOIN_MITER |
&h2000 |
Miter joins |
thickness
Thickness of the pen is defined in current map mode units. (A value of zero will result in a thickness of 1 pixel.) Note that this differs from the similar function SETPEN, which interprets thickness as being in pixel units.
r, g, b
The r, g, and b parameters are optional, but if specified, must all be specified. See the SETTEXTCOLOR directive for notes.
SETPENEX was added to A-Shell in Build 931 of 22 May 05.
Comments
A sample print file, SETPEN.TXT in EXLIB:[908,37], illustrates these options. Note, however, that the join options do not appear to have any effect. They have been implemented and documented to match the underlying Windows ExtCreatePen() function, but it isn't clear what they are for.
The endcap options are quite useful though. By default, line segments have rounded endcaps consisting of a semicircle with diameter equal to the width of the line, making them more significant as the line thickness increases. The square option makes the endcaps square, which is equivalent to extending the lines by half their thickness, on each end. This may seem illogical at first (i.e. why not just ask for a longer line?) but is actually useful for making complete corners. If you don't want any endcaps, then use the flat option (which is probably what you were expecting in the first place).