源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

c# Graphics使用方法(画圆写字代码)

  • 时间:2022-08-31 21:22 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:c# Graphics使用方法(画圆写字代码)
[b]画填充圆[/b]:        
[u]复制代码[/u] 代码如下:
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
[b]画圆圈[/b]:
[u]复制代码[/u] 代码如下:
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
[b]写字[/b]:
[u]复制代码[/u] 代码如下:
Graphics gra = this.pictureBox1.CreateGraphics(); Font myFont = new Font("宋体", 60, FontStyle.Bold); Brush bush = new SolidBrush(Color.Red);//填充的颜色 gra.DrawString("编程素材网!", myFont, bush, 100, 100);
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部