Image.FromFile gives "Out of Memory" Exception for icon
I got "Out of memory" exception when load an ".ico" file use System.Drawing.Image.FromFile,
Image.FromFile(sFilePath, true);
but don't get any exception when load a ".jpg" file, and there are same permission settings for these files. I found a post which said the exception caused by it doesn't have sufficient permission. :(And I still got "Paramter is not vaild" exception when load the ico use Image.FromStream.
FileStream fs = new FileStream(sFilePath, FileMode.Open, FileAccess.Read);
Image img = Image.FromStream(fs, true, true);
I'm confused, the codes seem work on another PC. :(Image img = Image.FromStream(fs, true, true);
Who knows what am i doing wrong?