【发布时间】:2012-02-07 06:54:55
【问题描述】:
在浏览器中显示.tiff 图像时出现以下错误。
A generic error occurred in GDI+.
我正在将.tiff 图像转换为.png,然后在浏览器中显示它们。
我的代码:
Response.ContentType = "image/png";
Response.AddHeader("content-disposition", "filename=" + Request.QueryString["path"]);
Image img = Image.FromFile(Request.QueryString["path"]);
img.Save(Context.Response.OutputStream, System.Drawing.Imaging.ImageFormat.Png);
但是,此错误仅出现在 Windows XP 中。相同的代码在 Windows 7 中运行良好。
【问题讨论】: