GRAPHIC LINE statement

Purpose

Draw a line on the selected graphic target

Syntax

GRAPHIC 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 the same terms (pixels or dialog units) as the parent dialog (or world coordinates, if those were chosen with GRAPHIC SCALE).  Line width can be set using GRAPHIC WIDTH.  If line width is set to 1 (the default), the line style can be set with GRAPHIC STYLE.

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 GRAPHIC statement.  If the first STEP option is included, the x1! and y1! starting coordinates are relative to the last point referenced (POS).

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.

See also

GRAPHIC ARC, GRAPHIC ATTACH, GRAPHIC BOX, GRAPHIC COLOR, GRAPHIC ELLIPSE, GRAPHIC PIE, GRAPHIC STYLE, GRAPHIC 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.

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

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

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