没人 帮忙嘛
简单问题阿
解决了  立刻 接铁
在线等

解决方案 »

  1.   

    帮你写了一个:在.aspx.cs中:
    先using:
    using System.Drawing.Drawing2D;
    using System.Drawing.Imaging;在Page_Load事件中添加:
    //定义图像的宽度、高度
    int width=200;
    int height=200;Bitmap b=new Bitmap(width,height);
    Graphics g=Graphics.FromImage(b);
    g.Clear(Color.Yellow);//清除整个绘图面以背景色填充g.SmoothingMode=SmoothingMode.AntiAlias;//画一条直线
    Pen p=new Pen(Color.Red);
    g.DrawLine(p,20,100,180,180);//画三角形
    GraphicsPath gp=new GraphicsPath();
    gp.StartFigure();
    gp.AddLine(100,10,10,100);
    gp.AddLine(10,100,190,100);
    gp.CloseFigure();
    Region reg=new Region(gp);
    g.FillRegion(Brushes.Green,reg);//设置输出图像格式
    Response.ContentType="image/Gif";
    b.Save(Response.OutputStream,ImageFormat.Gif);reg.Dispose();
    gp.Dispose();
    b.Dispose();
    g.Dispose();