Delphi - how do I crop a bitmap “in place”?
If I have a TBitmap and I want to obtain a cropped image from this bitmap, can I perform the cropping operation "in place"? e.g. if I have a bitmap that is 800x600, how can I reduce (crop) it so that it contains the 600x400 image at the centre, i.e. the resulting TBitmap is 600x400, and consists of the rectangle bounded by (100, 100) and (700, 500) in the original image? Do I need to go via another bitmap or can this operation be done within the original bitmap? You can use the BitBlt function try this code. procedure CropBitmap(InBitmap, OutBitMap : TBitmap; X, Y, W, H :Integer); begin