2013-03-07 52 views
1

您好我想显示的图像,创造动态使用GDI + 这是我的代码问题与OutputStream的

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的输出是这样的:

enter image description here

但在IE浏览器中显示正确(未在任何其他浏览器中测试)。什么是错误。?

+0

显示使用的代码在你的default.aspx.cs – Blachshma 2013-03-07 09:06:02

+0

页它只是在Page_Load事件 – Rakesh 2013-03-07 09:10:04

回答