Why is this particular image causing my application to crash with an OutOfMemoryException? Why is this particular image causing my application to crash with an OutOfMemoryException? wpf wpf

Why is this particular image causing my application to crash with an OutOfMemoryException?


As far as I can tell your problem corresponds to a known but currently unconfirmed bug in WPF, see Microsoft Connect. Funnily, the issue has been marked as duplicate, I'm however unable to find the other issue. I wouldn't be surprised if it was internal only...

Workaround

If your problem really is connected to the bug above, then there is an easy workaround: Just convert your palette-based PNG8 to a non-palette-based PNG24. This can be done e.g. using Photoshop or GIMP.