View Issue Details

IDProjectCategoryView StatusLast Update
0020226LazarusLCLpublic2011-10-07 15:12
ReporterChristian Assigned To 
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.Height := 1000;
  bmp.Width := 1000;
  bmp1 := TBitmap.Create;
  bmp1.Height := 1000;
  bmp1.Width := 1000;
  for i := 0 to 1000 do
TagsNo tags attached.
Fixed in Revision
Attached Files


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.


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