“System.OutOfMemoryException: Out of memory” When using Image.FromFile(imageFile)

“System.OutOfMemoryException: Out of memory” When using Image.FromFile(imageFile)

When I was populating an System.Drawing.Image object from a folder of images I revceived the following error message:
“System.OutOfMemoryException: Out of memory”
At first I thought I had a very large image in this folder, but realised after reading the blog post:
Image.FromFile(“…”) and System.OutOfMemoryException,
that I had a file in the folder that was not an image type i.e. Picasa.ini. Once this file was removed the page loaded.

Leave a Reply

Your email address will not be published. Required fields are marked *