嗨,我正在尝试显示一幅图像,这是使用GDI+创建的动态图像这是我的代码
Font font = new Font("Impact", 20, FontStyle.Regular);
Bitmap image = new Bitmap(300,50);
Graphics g = Graphics.FromImage(image);
g.DrawString("This is a test", font, Brushes.Blue,10,5);
image.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Gif);
g.Dispose();
image.Dispose();问题是,当我使用FireFox时,输出是这样的:

但在IE中它显示正确(没有在任何其他浏览器中测试)。这个错误是什么?
发布于 2013-03-07 17:06:41
确保您正在设置Response.ContentType。
HttpContext.Current.Response.ContentType = "image/gif";点击此处:http://forums.asp.net/t/1572453.aspx/1
https://stackoverflow.com/questions/15266930
复制相似问题