You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using AsBitmap() it leaks memory and causes application failures that depend on the Bitmap object. This is due to the custom pointer we create and manually setting the stride.
Reproduction Steps
Load a large raw image using the following algorithm
The above code will still leak even if you manually managed the IDisposable and implement this inside of a wrapper. Once you start zooming in on the bitmap in the UI application it will quickly run out of memory
Workaround
The best workaround I could find was converting the image to a Bitmap saving it to disk and then loading the .bmp file into memory and returning it.
Description
When using
AsBitmap()
it leaks memory and causes application failures that depend on theBitmap
object. This is due to the custom pointer we create and manually setting the stride.Reproduction Steps
Load a large raw image using the following algorithm
The above code will still leak even if you manually managed the
IDisposable
and implement this inside of a wrapper. Once you start zooming in on the bitmap in the UI application it will quickly run out of memoryWorkaround
The best workaround I could find was converting the image to a
Bitmap
saving it to disk and then loading the.bmp
file into memory and returning it.The text was updated successfully, but these errors were encountered: