Displaying very large images

Started by niceday, February 18, 2016, 04:30:45 PM

Previous topic - Next topic

niceday

Firstly, a huge thank you for creating ImageBox. It has saved me considerable time on an open source project I'm currently in the early stages of working on.

My issue is that I sometimes need to display large images, for example, a 1920 * 50000 png image (although this can be larger). Trying to load these large images in an ImageBox causes the application to freeze and become unresponsive.

Loading images this large into a .NET application is a general problem, not an ImageBox problem, but I wondering if you knew of a way to display these large images using ImageBox?



Richard Moss

Hello,

Thanks for the post, I'm glad you find ImageBox useful!

For actually displaying huge images, I'd probably suggest using virtual mode and breaking your image into smaller images and then paint the visible selection them using the virtual draw method - this sort of grid based painting seems to be the way things like Google/Bing Maps etc work.

As for the image loading problem, I've never tried loading images that big myself so it's not an issue I've come across before.

Have you looked at something like FreeImage? I use this myself to support loading of various image formats, I wonder if this might be more suited to loading larger images if GDI+ is choking. Or, if it could at least load the RGBA data for you to custom process (e.g. creating smaller images)

Offhand I can't really think of anything better, except writing a custom PNG decoder which I would imagine to be a pretty complex task!

Sorry I can't be more specific :(

Regards;
Richard Moss
Read "Before You Post" before posting. Do not send me private messages. Do not expect instant replies.

All responses are hand crafted. No AI involved. Possibly no I either.