unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;
type
TForm1 =
class(TForm)
Image1: TImage;
Edit1: TEdit;
Edit2: TEdit;
procedure Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
procedure FormCreate(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
oldPos:TPoint;
hoehe,breite:integer;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
var a,b:integer;
begin
edit1.Text:=IntToStr(mouse.CursorPos.X);
edit2.Text:=IntToStr(mouse.CursorPos.y);
a:=StrToInt(edit1.Text);
b:=StrToInt(edit2.Text);
if ssLeft
in Shift
then
begin
image1.Canvas.Pen.Style:=graphics.pssolid;
image1.Canvas.LineTo(x,y);
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Form1.DoubleBuffered:=true;
image1.Canvas.Rectangle(0,0,image1.Width,image1.Height);
image1.Canvas.Pen.Style:=graphics.psDot;
image1.Canvas.Brush.Style:=bsClear;
end;
end.