2

BMP image size is less then 20k X 20k then load successfully.

Issue related to 33k X 33k image size. It's not loading and given error "The image format is unrecognized."

I'm trying to load image in WPF Image control. If any alternate WPF control available then please let me know.

Can anyonehelp me?

wpf
  • 103
  • 6
  • 2
    This image, uncompressed, will take 3 GB of memory. If the BMP file is in a proper format, this size might be the culprit. Officially WPF can take larger images but depending on the machine that is used 3 GB might cause issues. Can the image be loaded into other programs? – Emond Jun 30 '22 at 09:25
  • 2
    I also assume that size is the cause of the issue. Check these threads - https://stackoverflow.com/questions/29175585/what-is-the-maximum-resolution-of-c-sharp-net-bitmap, https://stackoverflow.com/questions/4312169/net-object-size-limit#:~:text=NET%20limits%20any%20object%20to,limit%20of%20a%20single%20object. – zaphod-ii Jun 30 '22 at 09:32
  • 2
    Also [max resolution of .bmp file format](https://stackoverflow.com/questions/30941050/max-resolution-of-bmp-file-format). Usually when dealing with very large resolution image data you would split the image into tiles, and possibly into a "pyramid", i.e. multiple resolution levels. And only load the tiles you need for display. – JonasH Jun 30 '22 at 09:36

1 Answers1

0

Is it necessary for you to show whole image? I recommend you to resize it to available (e.g. 1920x1080) size before visualizing (e.g. using ImageSharp nuget). Depends on target size the image may be close to indistinguishable with original for human eye.

Hope it will be useful for you.