TCanvas.Draw fails with non-device PixelFormat TBitmap.
Original Reporter info from Mantis: PaulFMichell
-
Reporter name: Paul Michell
Original Reporter info from Mantis: PaulFMichell
- Reporter name: Paul Michell
Description:
The following code fails when the PixelFormat is not set to the format of the display device. This code works on Delphi 6 regardless of the PixelFormat set.
On Lazarus on Linux the application crashes.
procedure TMainForm.CreateButtonClick(Sender: TObject);
var
Picture: TBitmap;
begin
Picture := TBitmap.Create;
try
Picture.PixelFormat := pf16bit; //pfDevice;
Picture.Width := 10;
Picture.Height := 10;
Picture.Canvas.Rectangle(0,0,9,9);
Canvas.Draw(0,0,Picture);
finally
Picture.Free;
end;
end;
Mantis conversion info:
- Mantis ID: 7184
- Version: 0.9.17 (SVN)
- Monitored by: » @theo222 (theo)