您当前的位置: 首页 >  c#

彭世瑜

暂无认证

  • 1浏览

    0关注

    2791博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

C#编程-133:绘制椭圆、弧、扇形_彭世瑜_新浪博客

彭世瑜 发布时间:2017-08-20 15:27:51 ,浏览量:1

C#编程-133:绘制椭圆、弧、扇形
  1. using System.Drawing;
  2. using System.Windows.Forms;
  3.  
  4. namespace RectangleTest
  5. {
  6.     public partial class Form1 : Form
  7.     {
  8.         public Form1()
  9.         {
  10.             InitializeComponent();
  11.         }
  12.  
  13.         private void Form1_Paint(object sender, PaintEventArgs e)
  14.         {
  15.             Graphics g = e.Graphics;
  16.             Pen pen = new Pen(Color.Orange,3);
  17.             g.DrawRectangle(pen,10,10,100,50);
  18.             g.DrawLine(pen,new Point(10,70) ,new Point(110,70));
  19.  
  20.             //startangle从X轴顺时针方向旋转起始角
  21.             //sweepangle,起始角开始,顺时针方向旋转的角度,单位为度
  22.             g.DrawArc(pen,0,50,200,200,0,180);//绘制弧
  23.  
  24.             g.DrawPie(pen,200,50,200,200,0,90);//绘制扇形
  25.         }
  26.     }
  27. }
关注
打赏
1665367115
查看更多评论
立即登录/注册

微信扫码登录

0.1013s