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?
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?
相关文章推荐
- 严重: Servlet.service() for servlet default threw exception java.lang.OutOfMemoryError: Java heap spac
- MATLAB报错“Exception in thread "FileDecorationCache request queue" java.lang.OutOfMemoryError: Java “
- Problems with System.OutOfMemoryException At System.String.GetStringForStringBuilder in 32-Bit Managed Solutions
- ASP.NET中的OutOfMemoryException(from kaneboy)
- 错误(图片OutOfMemory):android.view.InflateException: Binary XML file line
- 调用Graphics.FromImage()出现OutofMemory的异常
- an out of memory error has occurred.Consult the 'running eclipse' section of the read me file for...
- .net 中的bug:System.OutOfMemoryException At System.String.GetStringForStringBuilder
- weblogic10.3登录控制台报错Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandle解决办法
- java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "javamelody jenkins
- Problems with System.OutOfMemoryException At System.String.GetStringForStringBuilder in 32-Bit Managed Solutions
- ASP.NET中的OutOfMemoryException(from kaneboy)
- java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread 报错解决
- java web中的Exception in thread "ContainerBackgroundProcessor[StandardEngine[Catalina]]" java.lang.OutOfMemoryError: PermGen space
- System.OutOfMemoryException
- 關於 ASP.NET 中System.OutOfMemoryException 的問題與解決方法
- [转帖]OutOfMemoryException问题的处理
- 【转】ASP.NET中OutOfMemoryException异常的处理方案
- .Net 内存溢出(System.OutOfMemoryException)的常见情况和处理方式总结
- Exception in thread "AWT-Shutdown" java.lang.OutOfMemoryError: PermGen space