码迷,mamicode.com
首页 > 其他好文 > 详细

绘制文字

时间:2019-01-12 00:17:00      阅读:124      评论:0      收藏:0      [点我收藏+]

标签:sha   oat   this   vat   技术   div   inf   image   oid   

实现效果:

  技术分享图片

知识运用:

  Graphics类的DrawString方法

  public void DrawString (string s, Font font, Brush brush,float x flloat y)  //在指定位置且用指定的Brush和Font对象绘制指定的文本字符串

实现代码:

        private void button1_Click(object sender, EventArgs e)
        {
            string str = "昏暗 与 灯火阑珊";
            Graphics graphics = this.CreateGraphics();
            Font font = new Font("华文行楷",25);
            SolidBrush myBrush = new SolidBrush(Color.PowderBlue);  //创建画刷对象
            graphics.DrawString(str,font,myBrush,50,60);            //绘制图像
        }

  

绘制文字

标签:sha   oat   this   vat   技术   div   inf   image   oid   

原文地址:https://www.cnblogs.com/feiyucha/p/10257738.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!