在asp.net中输出bitmap对象

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了在asp.net中输出bitmap对象相关的知识,希望对你有一定的参考价值。

Bitmap bmp = new Bitmap(100, 100);
        Graphics g = Graphics.FromImage(bmp);
        g.Clear(Color.White);

        g.DrawString("abc", new Font("宋体", 12), new SolidBrush(Color.Red), 0, 0);

        System.IO.MemoryStream ms = new System.IO.MemoryStream();
        bmp.Save(ms, System.Drawing.Imaging.ImageFormat.Gif);
        Response.BinaryWrite(ms.GetBuffer());

 

以上是关于在asp.net中输出bitmap对象的主要内容,如果未能解决你的问题,请参考以下文章