---------------------------------------
看到delphi有这样的代码:
procedure TInteractiveGestureForm.OnPan(Sender: TObject; Delta: TPoint);
var
I: Integer;
Image, Image2: TImage;
begin
//Pan
for I := 0 to FImages.Count - 1 do
begin
Image := FImages[I];
Image.Left := Image.Left - Delta.X;
end;
//Rotate images
Image := FImages[0];
if Image.Left + Image.Width < 0 then
begin
FImages.Add(Image);
FImages.Delete(0);
end
else if Image.Left > 0 then
begin
FImages.Insert(0, FImages[FImages.Count - 1]);
FImages.Delete(FImages.Count - 1);
Image := FImages[0];
Image2 := FImages[1];
Image.Left := Image2.Left - Image.Width;
end;
end;
procedure TInteractiveGestureForm.Panel1Gesture(Sender: TObject;
const EventInfo: TGestureEventInfo; var Handled: Boolean);
begin
if EventInfo.GestureID = igiPan then
begin
if not (gfBegin in EventInfo.Flags) then
OnPan(Sender, Point(FLast.X - EventInfo.Location.X,
Flast.Y - EventInfo.Location.Y));
FLast := EventInfo.Location;
end;
end;