Click here to Skip to main content
11,789,706 members (63,276 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C++ C# CSS Linux Cloud
Hi All,

I want to create large size image size more than 32000x32000 pixels .

Any idea how to create very large size image.

After creating that huge size image I want to load it into c# picture box . Normal size image easily loaded but what to do when I have huge(large size image)

Please help me.

Thanks in Advance.

[edit]DON'T SHOUT. Using all capitals is considered shouting on the internet, and rude (using all lower case is considered childish). Use proper capitalisation if you want to be taken seriously. Shouting won't change the laws of physics (or the laws of .NET) - OriginalGriff[/edit]
Posted 26-Jun-11 20:34pm
Edited 27-Jun-11 1:33am
esmailian at 27-Jun-11 3:16am
program or a pic create with phothoshop?
CPallini at 27-Jun-11 3:28am
I'm worried about the monitor you have to see such image.
CPallini at 27-Jun-11 3:29am
What is the purpose of creating such a big image (there may be better alternatives)?
samimaa786 at 27-Jun-11 4:42am
i want to create pic (image of huge size)
OriginalGriff at 27-Jun-11 7:31am
Read my answer: You cannot load an image of that size into any C# control.
.NET has a maximum size of any single object of 2GB - your image exceeds that by at least a factor of two.
(And this is ignoring that even if you could, a Picturebox would be a very dumb way to display such a big image!)
BobJanova at 27-Jun-11 11:23am
I too see no purpose in such a huge image. What problem are you trying to solve?
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

First thing: forget C#, forget any managed language: an image of 32000x32000 has 1,024,000,000 pixels, which means 4,096,000,000 bytes. This is too big for a single object in .NET which has a maximum size of 2GB.

You may be able to do it in native C++, but it will be slow, slow, slow to work with...
Ramalinga Koushik at 27-Jun-11 7:24am
Good Call. My 5 too.
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

This question require a lot of memory, at this rate you have to break that picture into small and managable pieces. This approach also require memory managment and using helper memory(s).

The key point is breaking & sampling (divide and conquer approach). If you wanna display 1000x1000 in view port sized 100x100 your have to display and 1/10 of pixels.

Try creating Blocks and Block Manager and ViewPort
Rate this: bad
Please Sign up or sign in to vote.

Solution 4

on my 64 bit machine (4gb ram), there was no problem witch pictures upto 16000x16000. above this values, the performance breakdown was .... tremendous. maybe it would work with enough memory.

furthermore, for the moment, when the bitmap is assigned to the picturebox image, it seems he needs the memory TWICE - with large pictures i observed a short memory peak of about double the size of the picture ...
Rate this: bad
Please Sign up or sign in to vote.

Solution 5

Youp need to look at tiled image formats; you cannot just load an image of that size as a whole!

You have to find a way to load only sections of the image in memory to be able to display it.

Usually the image is split in tiles, each tile is a determined size (optimized for fast loading), and when you want to display the image in a region of the screen, you load the appropriate tiles corresponding to that section of the image.

I know TIFF offer that feature as well as other types of format; but you will need to do some work yourself.

Deep Zoom file format (msdn) [^]


Ramalinga Koushik at 27-Jun-11 7:24am
Nice Link.My 5 too.

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

  Print Answers RSS
0 OriginalGriff 999
1 Maciej Los 765
2 KrunalRohit 686
3 CPallini 606
4 Richard MacCutchan 430

Advertise | Privacy | Mobile
Web01 | 2.8.1509028.1 | Last Updated 27 Jun 2011
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100