Pen

Description:              This function returns a pen value.

Returns:                    Pen

Usage:                       Steady State

Format:                      Pen(Color, Style, Width)

Parameters:             Color    { numeric }  { required }  { no default: }

                                      Any numeric expression giving the color of the line. Any value less than 0 or greater than 255 is invalid.

                                    Style    { numeric }  { required }  { no default: }

                                      Any numeric expression giving the line style. Valid line styles are from 1 to 5 inclusive. A line style of 1 is a solid line. See Chapter 9 for more styles.

                                    Width    { numeric }  { required }  { no default: }

                                      Any numeric expression that gives the line width in pixels.

Comments:               Pen values are used in layered graphics statements that draw lines (such as GUIArc or GUIRectangle).

                             Under Windows™ 95, Pen may have a Width greater than 1 or it may have a non-solid line style (Style greater than 1), but not both. If both the Style and Width parameters are set to values larger than 1, the resulting pen will use the style indicated, but will draw at a thickness of only 1 pixel.

Example:

GUIArc(728, 227, 477, 50 { Bounding box for arc },

       1, 1, 1, 1, 1 { No scaling }, 

       0, 0 { No trajectory or rotation }, 

       1, 0 { Arc is visible; reserved }, 

       0, 0, 0 { Cannot be focused/selected }, 

       Pen(14 { yellow }, 3 { dotted }, 2 { pixel width }), 

       Vertex(1 { Double smooth mode }, 

       Point(602.5, 138.5, Invalid, Invalid), 

       Point(710, 293, Invalid, Invalid),

       Point(413, 52, Invalid, Invalid)));

This shows how a Pen statement may be used to affect the attributes of a drawing object. In the above example, the arc will be drawn with a dotted yellow line 2 pixels wide.

See Also:

Brush