Sign in Join
Wiki copytemporary

Canvas line: what changed

Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.

Title: Canvas line

OldNewLine
1+The **Canvas.Line(x1, y1, x2, y2)** statement will draw a line from point (x1, y1) to (x2, y2).
2+
3+The coordinates of the canvas are:
4+
5+<figure>
6+<img src="canvas2.png" title="canvas2.png" />
7+<figcaption>canvas2.png</figcaption>
8+</figure>
9+
10+This code will draw the diagonals in a form:
11+
12+``` pascal
13+procedure TForm1.Form1Paint(Sender: TObject);
14+begin
15+ Canvas.Line(0, 0, Width-1, Height-1);
16+ Canvas.Line(0, Height-1, Width-1 ,0);
17+end;
18+```
19+
20+## See also
21+
22+- [[Drawing with canvas]]
23+
24+---
25+*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](/wiki-contact).*
26+Category: GUI
27+Category: LCL

Back to history