View Issue Details

IDProjectCategoryView StatusLast Update
0035963LazarusOtherpublic2019-10-10 17:51
ReporterWOTAGaming Assigned ToZeljan Rikalo  
Status closedResolutionno change required 
Product Version2.0.4 
Summary0035963: Cannot create certain amount of TPortableNetworkGrapic instances
DescriptionI'm developing game that use many PNGs sprites for drawing on TCanvas. I have array of 32 tilelists which are I am cutting into small tiles to 512 from every of them. I have PNGs besides those.
I use TLazIntfImage as intermediary to create and fill PNG object. And upon reaching some certain quantity of sprites inside TPortableNetworkGrapic.LoadFromIntfImage and then TLazIntfImage.CreateBitmaps program raise an silent error 'Failed to create handles'. Silent means application just freezes, but I find error in this point. CreateBitmaps sets new handla as 0.

When I use another method (not cutting pics into sprites and use TCanvas.ClipRect instead of TCanvas.Draw) it works, because I decrease amount of pictures. But this method decreases FPS, so I cant use it everywhere.
Steps To ReproduceTry to create so many PNGs as possible through converting from TLazIntfImage.
Fixed in Revision
Attached Files



2019-08-14 12:15

reporter   ~0117668

Last edited: 2019-08-14 12:21

View 2 revisions

I've just tested and found that only 9966 PNGs I can to create.

Testing procedure

procedure TForm1.Button1Click(Sender: TObject);
  PNGs:array of TPortableNetworkGraphic;




 while true do




2019-10-07 13:13

reporter   ~0118391

OK this is Windows problem. GUI32 limits 10000 handles for gui objects per proccess

Zeljan Rikalo

2019-10-07 18:23

developer   ~0118395

Please close

Issue History

Date Modified Username Field Change
2019-08-14 11:45 WOTAGaming New Issue
2019-08-14 11:51 WOTAGaming Tag Attached: PNGImageException
2019-08-14 12:15 WOTAGaming Note Added: 0117668
2019-08-14 12:21 WOTAGaming Note Edited: 0117668 View Revisions
2019-10-07 13:13 WOTAGaming Note Added: 0118391
2019-10-07 18:23 Zeljan Rikalo Assigned To => Zeljan Rikalo
2019-10-07 18:23 Zeljan Rikalo Status new => resolved
2019-10-07 18:23 Zeljan Rikalo Resolution open => no change required
2019-10-07 18:23 Zeljan Rikalo LazTarget => -
2019-10-07 18:23 Zeljan Rikalo Widgetset Win32/Win64 => Win32/Win64
2019-10-07 18:23 Zeljan Rikalo Note Added: 0118395
2019-10-10 17:51 WOTAGaming Status resolved => closed