TBitmap.CopyRect from TPaintbox.canvas bug
Original Reporter info from Mantis: leonardorame
-
Reporter name: Leonardo M. Ramé
Original Reporter info from Mantis: leonardorame
- Reporter name: Leonardo M. Ramé
Description:
When doing a TBitmap.CopyRect from a TPaintBox's canvas, the bitmap is filled with all the content inside AND over the PaintBox surface. I should only copy the content's of the paintbox:
Here's an example:
var
lBmp: TBitmap;
begin
lBmp := TBitmap.Create;
lBmp.Width := PaintBox1.Width;
lBmp.Height := PaintBox1.Height;
try
lBmp.Canvas.CopyRect(
Rect(0, 0, lBmp.Width, lBmp.Height),
PaintBox1.Canvas,
Rect(0, 0, lBmp.Width, lBmp.Height)
);
Clipboard.Assign(lBmp);
finally
lBmp.Free;
end;
I also attached a testing program.
Mantis conversion info:
- Mantis ID: 21981
- Version: 1.1 (SVN)