Torbins, велике дякую. Начебто робить:
procedure TViewForm.VImageGesture(Sender: TObject;
const EventInfo: TGestureEventInfo; var Handled: Boolean);
var
LObj: IControl;
HorizontalPercent, VerticalPercent: Single;
NewPos: TPointF;
begin
if EventInfo.GestureID = igiZoom then
begin
LObj := Self.ObjectAtPoint(ClientToScreen(EventInfo.Location));
if LObj is TImageViewer then
begin
if (not(TInteractiveGestureFlag.gfBegin in EventInfo.Flags)) and
(not(TInteractiveGestureFlag.gfEnd in EventInfo.Flags)) then
begin
VImage.BeginUpdate;
HorizontalPercent := (VImage.ViewportPosition.X + VImage.ClientWidth/2) / (VImage.Bitmap.Width * VImage.BitmapScale);
VerticalPercent := (VImage.ViewportPosition.Y + VImage.ClientHeight/2) / (VImage.Bitmap.Height * VImage.BitmapScale);
if (EventInfo.Distance - FLastDistance)/2 > 0 then VImage.BitmapScale:=VImage.BitmapScale + 0.03 else
if (EventInfo.Distance - FLastDistance)/2 < 0 then VImage.BitmapScale:=VImage.BitmapScale - 0.03;
NewPos.X := VImage.Bitmap.Width * VImage.BitmapScale * HorizontalPercent - VImage.ClientWidth/2;
NewPos.Y := VImage.Bitmap.Height * VImage.BitmapScale * VerticalPercent - VImage.ClientHeight/2;
VImage.ViewportPosition := NewPos;
VImage.EndUpdate;
end;
FLastDistance:=EventInfo.Distance;
Handled:=True;
end;
end;