Bitmap from file too big

  • Thread starter Thread starter carmen
  • Start date Start date
C

carmen

I'm trying to work with a big bmp file (240.000 bytes) and get an
OutOfMemory exception in this sentence:

Bitmap myBmp = new Bitmap(myFileName);

Is there anything that I could do?

Thank you!

Carmen
 
What bitmap format is it? What is the pixel dimensions?

The file size means just about nothing because when opened the file could be
expanded to a raster with X*Y*4 bytes.

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

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

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

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 
240.000 bytes is a big file???? Did u mean 240, 000 bytes or even 240
MB??

I just tried a BMP file that is 15,116,598 bytes (14.4MB) and it works
perfectly for me.
 
Back
Top