悬赏园豆:100
[已关闭问题]
I got "Out of memory" exception when load an ".ico" file use <FONT face=Verdana>System.Drawing.Image.FromFile, <BR>
<DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><IMG alt="" src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">Image.FromFile(sFilePath, </SPAN><SPAN style="COLOR: #0000ff">true</SPAN><SPAN style="COLOR: #000000">);</SPAN></DIV>but don't get any exception when load a ".jpg" file, and there are same permission settings for these files. I found a <A href="http://jcapka.blogspot.com/2006/06/imagefromfile-gives-out-of-memory.html"><FONT color=#0000ff>post</FONT></A> which said the exception caused by it doesn't have <FONT face=Verdana>sufficient permission. :(<BR></FONT><BR>And I still got "Paramter is not vaild" exception when load the ico use Image.FromStream. <BR>
<DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><IMG alt="" src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">FileStream fs </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000"> FileStream(sFilePath, FileMode.Open, FileAccess.Read);<BR><IMG alt="" src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align=top>Image img </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> Image.FromStream(fs, </SPAN><SPAN style="COLOR: #0000ff">true</SPAN><SPAN style="COLOR: #000000">, </SPAN><SPAN style="COLOR: #0000ff">true</SPAN><SPAN style="COLOR: #000000">);</SPAN></DIV>I'm confused, the codes seem work on another PC. :(<BR><BR>Who knows what am i doing wrong?</FONT>
蒜头
|
初学一级
|
园豆:
100
提问于:2008-03-18 11:00