In our application, we have several GDI + objects that are often used in many different contexts. This includes some examples Font, SolidBrush(white, black ...), some Pen...
Font
SolidBrush
Pen
For these objects, our strategy so far has been to hold them through read-only static visible fields. This allows you to create or delete them millions of times. We took care of access to the security stream on this object, of course (they are simply accessible from the user interface stream basically).
There are only a few of these GDI + objects for the life of the application, for example, 200. The rest of the GDI + objects (those with a short lifespan) are all located as soon as possible. But we sometime receive an unexpected exception from failures of GDI + resources, I hope, seldom enough.
I am wondering if these exceptions can come from these few GDI + objects, and if this were a more reasonable strategy for creating / deleting tons of GDI + objects with a short validity period. Does anyone have real experience and relevant conclusions about the two strategies?
System.Drawing . , . , . 65535 . , , , , . , , - . , . .NET, .
, , . . , , , , . , GC, GDI. 10 000 . . , System.Drawing , GC , 10000 .
, . View + Select Columns "GDI Objects". "USER Objects", , . , . .
Source: https://habr.com/ru/post/1534663/More articles:QComboBox with flags - qthttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1534659/spring-data-jpa-repository-findall-method-using-flag-column&usg=ALkJrhgibZkCf15Wa1mkI8hlJY46hNBUZglinux umask for sudo and apache - linuxОграничить размер виджета диалогового окна JQuery UI? - javascriptRestKit - the object (zero) is not the key for encoding the key for the key "id" - iosHow to install TimeZone in android - javaCordova 3.4.0: Camera.getPicture() возвращает кодированный URI, если выбран из GALLERY - androidQTP cannot click OK button of window popup when virtual machine is minimized - virtual-machineRuby Hash interaction with clicking on an array - ruby | fooobar.comCan I write my own streaming fusion in a library in Haskell? - haskellAll Articles