using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Drawing;

namespace BitMap
{
    /// <summary>
    /// Image 的摘要说明
    /// </summary>
    public class Image : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/jpeg";

            //画板
            using (Bitmap bitMap = new Bitmap(100, 100))
            {
                //画笔
                using (Graphics g = Graphics.FromImage(bitMap))
                {
                    g.DrawString("Cupid", new Font("微软雅黑", 20), Brushes.Blue, new Point(10, 5));
                    bitMap.Save(context.Response.OutputStream,System.Drawing.Imaging.ImageFormat.Jpeg);
                }
            }
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}

  

相关文章:

  • 2022-01-04
  • 2021-12-09
  • 2021-06-19
  • 2022-12-23
  • 2022-12-23
  • 2021-11-24
  • 2021-09-03
  • 2022-03-03
猜你喜欢
  • 2021-07-02
  • 2022-12-23
  • 2022-12-23
  • 2021-12-02
  • 2022-02-20
  • 2022-12-23
  • 2021-12-01
相关资源
相似解决方案