System.Runtime.InteropServices.ExternalException: GDI+ 中发生一般性错误

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了System.Runtime.InteropServices.ExternalException: GDI+ 中发生一般性错误相关的知识,希望对你有一定的参考价值。

GDI+ 中发生一般性错误。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。

异常详细信息: System.Runtime.InteropServices.ExternalException: GDI+ 中发生一般性错误。

源错误:

行 58: g.FillPie(New SolidBrush(Color.Gold), outline, 0.0F, degree)
行 59: g.FillPie(New SolidBrush(Color.LightSeaGreen), outline, degree, 360 - degree)
*****行 60: bmp.Save(Server.MapPath("sex.jpeg"), ImageFormat.Jpeg)*****
行 61: seximage.ImageUrl = Server.MapPath("sex.jpeg")
行 62: g.Dispose()

源文件: g:\inetpub\wwwroot\indagate\view.aspx.vb 行: 60

堆栈跟踪:

[ExternalException (0x80004005): GDI+ 中发生一般性错误。]
System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams)
System.Drawing.Image.Save(String filename, ImageFormat format)
indagate.view.Page_Load(Object sender, EventArgs e) in g:\inetpub\wwwroot\indagate\view.aspx.vb:60
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()

有*号的地方错误

参考技术A *****行 60: bmp.Save(Server.MapPath("sex.jpeg"), ImageFormat.Jpeg)*****
是这样保存的
bmp.Save(Response.OutputStream,ImageFormat.Jpeg)

以上是关于System.Runtime.InteropServices.ExternalException: GDI+ 中发生一般性错误的主要内容,如果未能解决你的问题,请参考以下文章