画图

来源:互联网 发布:查看db2实例下数据库 编辑:程序博客网 时间:2024/05/16 00:53

   //画图
    private void DrawString(string s)
    {
        Bitmap bt = new Bitmap(s.Length * 20, 50);

        Graphics gs = Graphics.FromImage(bt);
        gs.Clear(Color.Azure);

        Font f = new Font("黑体",20);

        SolidBrush sh = new SolidBrush(Color.Red);
        gs.DrawString(s, f, sh, 5, 5);
        bt.Save(Server.MapPath("1.gif"), ImageFormat.Gif);

        this.Image1.ImageUrl = "~/1.gif";

        gs.Dispose();
        bt.Dispose();
   
    }

原创粉丝点击