Problem with big canvas on ScrollBox lazarus / 39-Graphics ---------------------------------------------------------------------- Tomi · 2024-03-01 14:08 Hello! I put images onto a ScrollBox and I would like copy pieces from those onto an other image with CopyRect() function. But when I click on the edge of these images on the ScrollBox, then the small image contains the pieces of scrollbar instead the other parts of the image, which sticking out from ScrollBox. Then, when I scroll away the image, CopyRect() produces white rectangles instead of right image. So, how big is the canvas of an image? Is it equal only with its visible area? Or how can I access to its whole parts when I scroll it back and forth? I create images with this procedure: 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 procedure TForm1.buttonImageAdClick(Sender: TObject);begin   if (imageOpener.Execute) and (sourcetiles<255) then   begin     tileimage[sourcetiles+1]:=TImage.Create(Self);     tileimage[sourcetiles+1].Parent:=placeofTiles;     tileimage[sourcetiles+1].Autosize:=true;     tileimage[sourcetiles+1].Transparent:=true;     tileimage[sourcetiles+1].Picture.LoadFromFile(imageOpener.FileName);     tileimage[sourcetiles+1].OnMouseUp:=@clickontile;     tileimage[sourcetiles+1].Left:=0;     if sourcetiles=0 then     begin        tileimage[sourcetiles+1].Top:=0;        actualtile:=1;   end     else        tileimage[sourcetiles+1].Top:=tileimage[sourceti les].Top+tileimage[sourcetiles].height+2;     inc(sourcetiles);   end;end;and this is where I copy small images from the tiles: 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 procedure TForm1.clickontile(Sender: TObject; Button: TMouseButton;  Shift: TShiftState; X, Y: Integer);var i: byte;begin     for i:=0 to sourcetiles-1 do     begin       if (X>=tileimage[i+1].Left) and (X<=tileimage[i+1].Left+tileimage[i+1].width) and (Y>=tileimage[i+1].Top) and (Y<=tileimage[i+1].Top+tileimage[i+1].height) then       begin          if copytileexists=false then            begin              copytile:=TImage.Create(Self);              copytile.Parent:=self;            copytile.Left:=X;//+tilePlace.HorzScrollbar.position;            copytile.Top:=Y;//+tilePlace.VertScrollbar.position;            copytile.width:=tilewidth;              copytile.height:=tileheight;          end;            copytile.canvas.copyrect(Rect(0,0,tilewidth,t ileheight),tileimage[i+1].canvas,Rect(X,Y,X+tilewidth,Y+tileheight));            copytileexists:=true;            Break;       end;     end;end; ---------------------------------------------------------------------- Tomi · 2024-03-02 14:34 Well, carefully read about these problem it seems that it is not easy to access to offscreen part of the images. But then how store the OS or Lazarus itself the content of whole image? Since I can see that when I scroll away the image in the ScrollBox.