您的位置:首页 > 其它

Image.FromFile gives "Out of Memory" Exception for icon

2008-03-17 20:02 537 查看
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. :(

Who knows what am i doing wrong?
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐