unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, jpeg, ExtCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Image1: TImage;
Image2: TImage;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
x1,x2,y1,y2,ox1,ox2,oy1,oy2:integer;
dist:integer;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
x1 := Image1.Left;
y1 := Image1.Top;
x2 := Image2.Left;
y2 := Image2.Top;
dist := sqrt(sqr((x2+ox2)-(x1+ox1))+sqr((y2+oy2)-(y1+oy1)));
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
ox1:=0;
ox2:=0;
oy1:=0;
oy2:=0;
end;
end.