滚屏 :
var
Draw : Boolean;
StartPt,MovePt : TPoint;
procedure TForm2.Image1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if Button=mbLeft then
begin
Draw :=True;
StartPt :=Point(x,y);
end;
end;
procedure TForm2.Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
if Draw then
begin
MovePt :=Point(x,y);
Form2.VertScrollBar.Position :=Form2.VertScrollBar.Position+StartPt.y-MovePt.y;
Form2.HorzScrollBar.Position :=Form2.HorzScrollBar.Position+StartPt.x-MovePt.x;
end;
end;
procedure TForm2.Image1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
Draw := False;
end;
procedure TMainForm.FormCreate(Sender: TObject);
begin
Draw :=False;
end;
参考这个思路就可以了.