Sign in Join
Wiki copytemporary

Revision 1 of 2, by Trev on 2-7-2020. The page as it is now.

Canvas line

The Canvas.Line(x1, y1, x2, y2) statement will draw a line from point (x1, y1) to (x2, y2).

The coordinates of the canvas are:

<figure> <img src="canvas2.png" title="canvas2.png" /> <figcaption>canvas2.png</figcaption> </figure>

This code will draw the diagonals in a form:

pascal
procedure TForm1.Form1Paint(Sender: TObject);
begin
  Canvas.Line(0, 0, Width-1, Height-1);
  Canvas.Line(0, Height-1, Width-1 ,0);
end;

See also


From the Free Pascal wiki, page "Canvas line", as it stood on 2020-02-07 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.