Click here to Skip to main content
15,789,698 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys. I am working on a Raster Map loader project. So far I have been able to load very large raster maps to a custom made user control, i.e 600 MB TIF FILE.

The thing is, I would ultimately want to load files of size 4 GB. But my program throws "OUT OF MEMORY exception" when I try to load files larger than 1 GB.

I have come to understand that there is no direct way of loading image files larger than 1GB. To this end, I have to read the image part by part. i.e I will read 500 MB of the image at one time and so on. I can guess how this works; only read part of the image that will be displayed to memory. And when the image is panned, remove the previously displayed part of the image from memory and load the newly displayed part.

The thing is I don't know how to read part of the image.

If you have any ideas or previous posts related to this?

Thanks in advance!
Updated 30-Sep-10 21:25pm
Biruk Sitotaw 22-Jul-11 2:02am    
Hi Beza am having the same problem too, if u have got the solution please help me out. Thank you.

(Provided you really need such a high resolution) Cannot you split the image file in multiple ones?

I suppose you have either to use a TIFF library (see, for instance libTiff[^]) or develop your own tool to perform the task (starting from TIFF specifications - see the 'External Links' section in this Wikipedia page[^]).
Share this answer
Bezawit 5-Aug-10 5:08am    
well, dat's what I didn't know how
Bezawit 1-Oct-10 2:24am    
Thanks for the answer.Any example how I can develop my own to tool to do the task?
CPallini 1-Oct-10 3:12am    
That's the hard way. You may have a look at libTiff sources, but I suppose they are difficult to understand.
Mapping/GIS people have developed a number of "tiled" image file formats for efficient access to this kind of image. I suggest you start with a Google search for "tiled image format". Also, some of them, like ECW, use compression to speed up the disk I/O. As an example, I use a coloured ECW map file bigger than 286100 x 398200 pixels that occupies 5,379,500 kB. (In other words, about 20 pixels per byte!) The mapping software I use can read any reasonable part (say 1k x 1k pixels) of this file in a second or two. The ECW people supply a free library.

Remember to vote for the answer, and mark it accepted if you like.
Share this answer

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