picoe / Eto

Cross platform GUI framework for desktop and mobile applications in .NET
Other
3.55k stars 323 forks source link

Wpf: Fix GDI handle issues when using resized Bitmaps #2552

Closed cwensley closed 11 months ago

cwensley commented 11 months ago

This fixes an issue if you keep many resized images in memory, each one will use upwards of 4+ GDI handles, and since there's only 10000 available per process this can cause a COMException. The main takeaway here is we should never be storing a WPF RenderTargetBitmap as it can exhaust GDI handles pretty easily especially when dealing with numerous small bitmaps.

See https://github.com/dotnet/wpf/issues/3067 for more context.