<< Click to Display Table of Contents >> Navigation: ThinBASIC Modules > UI (User Interface) > CONTROLS > Control Types > Canvas Control > Canvas Control Commands > Canvas_Line |
Description
Draw a line in the currently selected canvas target
Syntax
n = Canvas_Line( [STEP] [(x1, y1)], [STEP] (x2, y2) [, rgbColor] )
Returns
Number
Parameters
Name |
Type |
Optional |
Meaning |
x1 |
Number |
Yes |
The upper left corner of the box |
y1 |
Number |
Yes |
The upper left corner of the box |
x2 |
Number |
No |
The lower right corner of the box. |
y2 |
Number |
No |
The lower right corner of the box. |
rgbColor |
Number |
Yes |
RGB color of the box edge. If omitted (or -1), the edge color defaults to the current foreground color for the selected canvas window. |
Remarks
If the first STEP option is included, the x1 and y1 starting coordinates are relative to the last point referenced (POS).
If the second STEP option is included, the x2 and y2 ending coordinates are relative to the starting coordinates.
Restrictions
In this function it is mandatory to use () exactly as indicated by the above syntax. This is due to the optional starting x, y position and many possibilities in which this function can be used.
Without using mentioned syntax it would be impossible to determine correct requested behave.
See also
Examples