TPaintBox,TPanel,TForm BitBlt is 7 times slower than in Delphi
Original Reporter info from Mantis: Christian
-
Reporter name:
Original Reporter info from Mantis: Christian
- Reporter name:
Description:
When you Paint on an TForm, TPaintBox or TPanel with BitBlt or Draw
Delphi needs ~700ms Lazarus ~5sec on
drawing 1000 times an bitmap with red and after that an green rectangle with 1000x1000 px
Drawing in an TImage with same routines has equal times with ~700ms
It seems to be related to the DC
I have also tried wo use BitBlt directly from Windows unit, it makes nearly no difference to the Wrapper from LCL
Steps to reproduce:
bmp := TBitmap.Create;
bmp.PixelFormat:=;
bmp.Height := 1000;
bmp.Width := 1000;
bmp.Canvas.Brush.Color:=clred;
bmp.Canvas.Rectangle(0,0,1000,1000);
bmp1 := TBitmap.Create;
bmp1.Height := 1000;
bmp1.Width := 1000;
bmp1.Canvas.Brush.Color:=clGreen;
bmp1.Canvas.Rectangle(0,0,1000,1000);
for i := 0 to 1000 do
begin
Windows.BitBlt(Form1.Canvas.Handle,0,70,1000,1000,bmp.Canvas.Handle,0,0,SRCCOPY);
Windows.BitBlt(Form1.Canvas.Handle,0,70,1000,1000,bmp1.Canvas.Handle,0,0,SRCCOPY);
end;
Mantis conversion info:
- Mantis ID: 20226
- Version: 0.9.30.1 (SVN)