手机
当前位置:查字典教程网 >编程开发 >C#教程 >c# Graphics使用方法(画圆写字代码)
c# Graphics使用方法(画圆写字代码)
摘要:画填充圆:复制代码代码如下: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# Graphics使用方法(画圆写字代码)】相关文章:

C# SendKeys使用方法介绍

C#使用itextsharp生成PDF文件的实现代码

C# TrieTree介绍及实现方法

解析C#彩色图像灰度化算法的实现代码详解

c# 共享状态的文件读写实现代码

c# datetime方法应用介绍

C#中方法的详细介绍

C# TreeView控件使用代码

c#图片添加水印的实例代码

C# dynamic关键字的使用方法

精品推荐
分类导航