unit source;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, AdvPicture, AdvScrollBox, StdCtrls, ExtCtrls, jpeg;
type
TForm1 = class(TForm)
Panel1: TPanel;
pic: TImage;
procedure picMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure picMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
private
FX,FY:Integer;
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.picMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
FX := X;
FY := Y;
end;
procedure TForm1.picMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
var
CursorPos : TPoint;
dx, dy : Integer;
begin
if (ssLeft in Shift) then
begin
pic.Left := pic.Left - FX + X;
pic.Top := pic.Top - FY + Y;
end;
end;