XPRINT LINE statement

Purpose

Draw a line on a host printer page.

Syntax

XPRINT LINE [STEP] [(x1!, y1!)] - [STEP] (x2!, y2!)[, rgbColor&]

Remarks

The line is drawn from the first point, up to, but not including the second point.  Coordinate points are specified in pixels, unless optional world coordinates have been defined with an XPRINT SCALE statement.  Line width can be set using XPRINT WIDTH.  If line width is set to 1 (the default), the line style can be set with XPRINT STYLE. If executed without a host printer attached, error 57 is generated.

Windows graphic conventions consider the final x2 and y2 coordinates to be exclusive.  Therefore, by default, the final pixel is not drawn unless Overlap Mode is enabled.  See XPRINT SET OVERLAP for details.

x1!, y1!

Optional values which define the starting point of the line. If this optional first point is omitted, the line begins at the last point referenced ( POS ) in a preceding XPRINT statement.  If the first STEP option is included, the x1! and y1! starting coordinates are relative to the last point referenced (POS) on the host printer page.

x2!, y2!

The ending point of the line.  If the second STEP option is included, the x2! and y2! ending coordinates are relative to the starting coordinates.

rgbColor&

Optional RGB color value for the line.  If rgbColor& is omitted (or -1), the line color defaults to the current foreground color for the host printer page.

See also

Built In RGB Color Equates, XPRINT ARC, XPRINT ATTACH, XPRINT BOX, XPRINT COLOR, XPRINT ELLIPSE, XPRINT PIE, XPRINT POLYGON, XPRINT POLYLINE, XPRINT SET MIX, XPRINT SET OVERLAP, XPRINT STYLE, XPRINT WIDTH

Example

' Draw a triangle. Note that, since LINE draws up to,

' but not including the second point, one extra point

' must be added when STEP is used.

XPRINT LINE (10, 10) - (10, 100)  ' left side

XPRINT LINE STEP - (101, 100)     ' base line

XPRINT LINE STEP - (10, 10)       ' back to top