How crop image? lazarus / 39-Graphics ---------------------------------------------------------------------- Fortuna1 · 2011-07-07 14:13 How crop image? Thanks ---------------------------------------------------------------------- typo · 2011-07-07 14:32 On a TImage component? ---------------------------------------------------------------------- Mando · 2011-07-07 14:55 see the project. Load a bitmap  into image1, run an press button. regards. ---------------------------------------------------------------------- Fortuna1 · 2011-07-07 16:59 On a TImage component? Yes, I need crop  on a TImage component. When tray your included sample  I get  message The project requires the package "LCLBase (>=1.0.1)". But it was not found. See Project -> Project Inspector. I try this your sample in linux and windows lazarus 0.9.30.1 But I get error  The project requires the package "LCLBase (>=1.0.1)". But it was not found. See Project -> Project Inspector. ---------------------------------------------------------------------- Mando · 2011-07-07 17:07 You must remove LCLBase from the project. Project->Project inspector.  Remove LCLBase. Compile (Spanish?) ---------------------------------------------------------------------- Fortuna1 · 2011-07-07 17:42 Thanks! Wiith your help I finally managed to procedure CropBitmap(aBitmap: TBitmap; aRect: TRect); var bmp:TBitmap; r: TRect; begin   r:=aRect;// offsetRect(r,-r.left,-r.top);   bmp:=Tbitmap.create;   bmp.SetSize(r.right,r.bottom);   bmp.Canvas.CopyRect(r,aBitmap.Canvas,aRect);   aBitmap.Assign(bmp);   bmp.free; end; { TForm1 } procedure TForm1.BitBtn1Click(Sender: TObject); var r: Trect; begin   r:=rect(0,0,Image1.width div 2,Image1.height div 2);  // offsetRect(r,Image1.width div 4,Image1.height div 4);   CropBitmap(Image1.Picture.Bitmap,r); end; procedure TForm1.Button1Click(Sender: TObject); begin      Image1.Picture.LoadFromFile('/home/usb/tiskaj_blag/image4.png'); end; procedure TForm1.Button2Click(Sender: TObject); begin    Image1.Picture.SaveToFile('/home/usb/tiskaj_blag/imag.png'); end; offsetRect not working in linux.