View Issue Details

IDProjectCategoryView StatusLast Update
0020226LazarusLCLpublic2011-10-07 15:12
ReporterChristian Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status acknowledgedResolutionopen 
Product Version0.9.30.1 (SVN) 
Summary0020226: TPaintBox,TPanel,TForm BitBlt is 7 times slower than in Delphi
DescriptionWhen 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;
TagsNo tags attached.
Fixed in Revision
LazTarget-
WidgetsetWin32/Win64
Attached Files

Activities

Flávio Etrusco

2011-09-13 20:25

developer   ~0051797

Can you try setting SetStretchBltMode(STRETCH_DELETESCANS) in Lazarus, or check
what's the value of GetStretchBltMode() in Delphi? IIRC Lazarus changes the default stretch mode to one with higher quality.

Christian

2011-09-20 22:33

reporter   ~0052070

In Delphi is set STETCH_ANDSCANS

Flávio Etrusco

2011-09-20 22:59

developer   ~0052073

Last edited: 2011-09-20 23:32

Thanks. Did you test Delphi with STRETCH_HALFTONE?
Lazarus is always reseting the mode to STRETCH_HALFTONE, I'll report this in the mailing list.

Issue History

Date Modified Username Field Change
2011-09-12 22:01 Christian New Issue
2011-09-12 22:01 Christian Widgetset => Win32/Win64
2011-09-12 23:46 Maxim Ganetsky LazTarget => -
2011-09-12 23:46 Maxim Ganetsky Description Updated
2011-09-13 20:25 Flávio Etrusco Note Added: 0051797
2011-09-20 22:33 Christian Note Added: 0052070
2011-09-20 22:59 Flávio Etrusco Note Added: 0052073
2011-09-20 23:07 Flávio Etrusco Note Edited: 0052073
2011-09-20 23:32 Flávio Etrusco Note Edited: 0052073
2011-10-07 15:12 Vincent Snijders Status new => acknowledged