希望在明天

如果,你没有耐心等待成功的到来,那么,你将用一生的耐心去面对失败。

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, truetrue);
I'm confused, the codes seem work on another PC. :(

Who knows what am i doing wrong?

posted on 2008-03-17 20:02  蒜头  阅读(1021)  评论(0编辑  收藏  举报

导航