“GDI 中发生一般错误”在 Windows XP 中的浏览器中显示图像时出错
在浏览器中显示 .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 中运行良好。
I am getting following error while showing .tiff
images in a browser.
A generic error occurred in GDI+.
I am converting .tiff
images to .png
and then displaying them in a browser.
My code:
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);
However this error only comes up in Windows XP. The same code is works fine in Windows 7.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试使用位图参考进行转换
:
Converting TIFF files to PNG in .Net< /a>
http://bytes.com/topic/c-sharp/answers/267798-convert-tiff-images-gif-jpeg
Try to convert it using the BitMap
reference :
Converting TIFF files to PNG in .Net
http://bytes.com/topic/c-sharp/answers/267798-convert-tiff-images-gif-jpeg