[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.drawing

Fastest possible way to load a image file?

yosh

11/16/2004 10:34:00 AM

Hi, making a application that deals with 3 image files that are quite large. they are about 8000x8000px
in size, i have tryed to load them all into memory but i always get a out of memory exception
so i have given up on that idea... so now i have to load one image, process it and write the output
then open the next image and write that to the output files of the first image, and do the same with
the last.

this is much slower than it is to load all images into memory and process them there. so now im
wondering if theres some other faster way to load images into a bitmap object than

dim objBitmap = new bitmap(strFilename) ?

2 Answers

Bob Powell

11/16/2004 1:40:00 PM

0

Check out Justin Rogers blog archives. He has a utility for really quick
loading of images.

http://weblogs.asp.net/jus...


--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tips...

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/f...

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.





<yosh@liquidzone.net> wrote in message
news:H5WdnaDLScUxSgTcRVnygQ@giganews.com...
> Hi, making a application that deals with 3 image files that are quite
large. they are about 8000x8000px
> in size, i have tryed to load them all into memory but i always get a out
of memory exception
> so i have given up on that idea... so now i have to load one image,
process it and write the output
> then open the next image and write that to the output files of the first
image, and do the same with
> the last.
>
> this is much slower than it is to load all images into memory and process
them there. so now im
> wondering if theres some other faster way to load images into a bitmap
object than
>
> dim objBitmap = new bitmap(strFilename) ?
>


Etan Bukiet

11/17/2004 2:58:00 AM

0

This can actually be done in the DotNet Framework (without using your own
P/Invoke -- Of course System.Drawing Calls the runtime.)
This is faster than Justin Rogers because he uses reflection to convert the
GDI Pointer back to the managed Image object.

System.IO.Stream stream = System.IO.File.OpenRead(fileName);
System.Drawing.Image Picture = Image.FromStream(stream, false, false);

Look, no Reflection!! and it should be just as fast because no embeded color
management!

Etan Bukiet

<yosh@liquidzone.net> wrote in message
news:H5WdnaDLScUxSgTcRVnygQ@giganews.com...
> Hi, making a application that deals with 3 image files that are quite
> large. they are about 8000x8000px
> in size, i have tryed to load them all into memory but i always get a out
> of memory exception
> so i have given up on that idea... so now i have to load one image,
> process it and write the output
> then open the next image and write that to the output files of the first
> image, and do the same with
> the last.
>
> this is much slower than it is to load all images into memory and process
> them there. so now im
> wondering if theres some other faster way to load images into a bitmap
> object than
>
> dim objBitmap = new bitmap(strFilename) ?
>