Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Is this C#? I think the answer may be here.</p> <p><a href="https://stackoverflow.com/questions/3848132/out-of-memory-image-fromfile">out of memory Image.FromFile</a></p> <p>Top Answer from user: <a href="https://stackoverflow.com/users/31158/jordao">https://stackoverflow.com/users/31158/jordao</a></p> <blockquote> <p>In the <code>Image.FromFile</code> documentation, an <code>OutOfMemoryException</code> can be throw if:</p> <blockquote> <p>The file does not have a valid image format.</p> <p>-or-</p> <p>GDI+ does not support the pixel format of the file.</p> </blockquote> <p>Check your image format.</p> <p>Also, if you want to close the stream right after loading the image, you must make a copy of the image. Take a look here. GDI+ must keep the stream open for the lifetime of the image.</p> </blockquote> <p>Another top answer and thread to consider then:</p> <p><a href="https://stackoverflow.com/questions/1108607/out-of-memory-exception-on-system-drawing-image-fromfile">Out Of Memory exception on System.Drawing.Image.FromFile()</a></p> <p>From user: <a href="https://stackoverflow.com/users/22656/jon-skeet">https://stackoverflow.com/users/22656/jon-skeet</a></p> <blockquote> <p>It's worth knowing that OutOfMemoryException doesn't always really mean it's out of memory - particularly not when dealing with files. I believe it can also happen if you run out of handles for some reason.</p> <p>Are you disposing of all your bitmaps after you're done with them? Does this happen repeatably for a single image?</p> </blockquote> <p>Also, I would add- have you saved this file out using your code and tried to view it in another image viewer? It may be corrupt if it is being created incorrectly.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload