GDI DRAHPIC 画图

  //下面是显示出计数器
            System.Drawing.Bitmap bmp = new Bitmap(Bitmap.FromFile(Server.MapPath("2.jpg")));//载入图片  
            System.Drawing.Graphics g = Graphics.FromImage(bmp);
            g.DrawString("766666 ", new Font("宋体", 9), new SolidBrush(Color.Blue), 65, 56);
            g.DrawString(" 次", new Font("宋体", 9), new SolidBrush(Color.Red), 65, 26);
            g.DrawString(" 次", new Font("宋体", 9), new SolidBrush(Color.Red), 67, 42);


            //这里选择文本字体颜色  
            g.Dispose();
            //输出GIF,你要其它格式也可以自己改  
            Response.ContentType = "image/jpeg";
            bmp.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);//

 

 

 

///支持存储区为内存的流

  System.IO.MemoryStream ms = new System.IO.MemoryStream();
            bmp.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
            Response.ClearContent();
            Response.ContentType = "image/Png";
            Response.BinaryWrite(ms.ToArray());

你可能感兴趣的:(HP)