c# Graphics使用方法(画圆写字代码)_C#教程-查字典教程网
c# Graphics使用方法(画圆写字代码)
c# Graphics使用方法(画圆写字代码)
发布时间:2016-12-28 来源:查字典编辑
摘要:画填充圆:复制代码代码如下:Graphicsgra=this.pictureBox1.CreateGraphics();gra.Smooth...

画填充圆:

复制代码 代码如下:

Graphics gra = this.pictureBox1.CreateGraphics();

gra.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;

Brush bush = new SolidBrush(Color.Green);//填充的颜色

gra.FillEllipse(bush, 10, 10, 100, 100);//画填充椭圆的方法,x坐标、y坐标、宽、高,如果是100,则半径为50

画圆圈:

复制代码 代码如下:

Graphics gra = this.pictureBox1.CreateGraphics();

gra.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;

Pen pen = new Pen(Color.Pink);//画笔颜色

gra.DrawEllipse(pen, 250, 10, 100, 100);//画椭圆的方法,x坐标、y坐标、宽、高,如果是100,则半径为50

写字:

复制代码 代码如下:

Graphics gra = this.pictureBox1.CreateGraphics();

Font myFont = new Font("宋体", 60, FontStyle.Bold);

Brush bush = new SolidBrush(Color.Red);//填充的颜色

gra.DrawString("查字典教程网!", myFont, bush, 100, 100);

相关阅读
推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
  • 大家都在看
  • 小编推荐
  • 猜你喜欢
  • 最新C#教程学习
    热门C#教程学习
    编程开发子分类