滚屏 :
var
Draw : Boolean;
StartPt,MovePt : TPoint;
procedure TForm1.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 TForm1.Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
if Draw then
begin
MovePt :=Point(x,y);
Form1.VertScrollBar.Position :=Form1.VertScrollBar.Position+StartPt.y-MovePt.y;
Form1.HorzScrollBar.Position :=Form1.HorzScrollBar.Position+StartPt.x-MovePt.x;
end;
end;
procedure TForm1.Image1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
Draw := False;
end;