This question already has an answer here:
- out of memory Image.FromFile 6 answers
System.Drawing.Image original = System.Drawing.Image.FromFile(photo);
That's the code where i have the problem "Out of memory
."
"photo
" is a path of an image which the size is 6400x6400
.
Have anyone idea about that?
Since I assume this is in C#, is your code is in a loop or in the
Paint
event? This could explain why it is not working. If you load several images or a single image multiple times, you will of course encounter a "Out of memory" Exception.Is this C#? I think the answer may be here.
out of memory Image.FromFile
Top Answer from user: https://stackoverflow.com/users/31158/jordao
Another top answer and thread to consider then:
Out Of Memory exception on System.Drawing.Image.FromFile()
From user: https://stackoverflow.com/users/22656/jon-skeet
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.