unit graf1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
procedure FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
private
{ Private declarations }
public
Poz1 : Tpoint ;
Poz2 : Tpoint ;
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
Poz1 := point(x,y);
end;
procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
canvas.pen.mode := pmnot ;
Canvas.MoveTo(poz1.x,poz1.y) ;
Canvas.Lineto(Poz2.x,Poz2.y) ;
Canvas.MoveTo(poz1.x,poz1.y) ;
Canvas.Lineto(x,y) ;
poz2 := point(x,y) ;
end;
end.