Click here to Skip to main content
15,885,141 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I sometimes scan large format paper to black and white image files and the pixel size in either direction is often greater than the signed 16 bit limit of 32,767 pixels. When I use a PictureBox in VB.net I cannot load images of this size and an exception is produced.

I've done a lot of searching but it isn't clear if this limit can be exceeded in a PictureBox?

Several programs do offer manipulation of images larger than this limit so I'm wondering the best way to go about it ?

Thanks for any help!
Posted

How do you display such a large image?

For images that big, you should probably dynamically create a smaller image for the visible portion and display that smaller image.

If you go for the option to uses a third-party librairy, you should test them to see how they handled such large files.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 2-Jul-11 21:09pm    
I'm sure it would be possible, based on my experience. My 5.
--SA
codetowns 3-Jul-11 15:53pm    
Thanks for the replies. I will now attempt to write something for this.
You may try to use the control from this article :

Pan and Zoom Very Large Images[^]

Good luck
 
Share this answer
 
GDI cannot create an image that big, nor can you create any object in .NET large than 2GB in size (32bpp = 4 * 32767 * 32767 = 4GB).

Other programs can do it because they don't rely on such large objects or GDI. They create much smaller bitmap images on the fly and paint those images on screen themselves. They do not use a picturebox at all.

Frankly, I don't even know why the picturebox control exists. It's close to useless.
 
Share this answer
 
Comments
Christian Graus 5-Jul-11 17:47pm    
The PB exists for people who can't code much and just want to show a picture without handling a paint event.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900