1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
private
{ Déclarations privées }
dimtab:integer;
tabpoints:array of TPoint;
Procedure Addline(pt:Tpoint);
public
{ Déclarations publiques }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
Procedure TForm1.Addline(pt:Tpoint);
var i:integer;
begin
inc(dimtab);
setlength(tabpoints,dimtab);
tabpoints[dimtab-1]:=pt;
for i:=0 to dimtab-1 do canvas.polyline(tabpoints);
end;
procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
Addline(point(x,y));
end;
end. |