private
{ Private declarations }
tp:TPoint;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Image1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
tp:=ClientToScreen(Point(X,Y));
end;
procedure TForm1.Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
var
p:TPoint;
begin
if ssLeft in Shift then
begin
p:=ClientToScreen(Point(X,Y));
Image1.Left:=Image1.Left+(p.x-tp.x);
Image1.Top:=Image1.Top+(p.y-tp.y);
end;
end;
procedure TForm1.Image1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var
p:TPoint;
begin
p:=ClientToScreen(Point(X,Y));
Image1.Left:=Image1.Left+(p.x-tp.x);
Image1.Top:=Image1.Top+(p.y-tp.y);
end;