Wiki copymirror

This is a mirror of the wiki at pascal.chat. Editing, history and sign-in are there.

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:

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.

Revision 2, last changed by WikiArchive .