ImgView32 image mouse panning [SOLVED] lazarus / 39-Graphics ---------------------------------------------------------------------- Pe3s · 2024-08-25 05:52 Hello, how can I improve the code so that it works, I mean moving the image with the mouse together with scrollbars? Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i var  IsPanning: Boolean = False;  LastPoint: TPoint; procedure TForm1.ImgView32_1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);begin  if Button = mbLeft then  begin    IsPanning := True;    LastPoint := Point(X, Y);  end;end; procedure TForm1.ImgView32_1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);var  dx, dy: Integer;begin  if IsPanning then  begin    dx := X - LastPoint.X;    dy := Y - LastPoint.Y;     ImgView32_1.Offset := Point(ImgView32_1.Offset.X + dx, ImgView32_1.Offset.Y + dy);     LastPoint := Point(X, Y);  end;end; procedure TForm1.ImgView32_1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);begin  if Button = mbLeft then    IsPanning := False;end;