在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());

 

posted @ 2016-02-28 00:02  昨日已逝  阅读(1195)  评论(0)    收藏  举报