绘制圆弧

实现效果:

  

 知识运用:

  Graphics类的DrawArc方法

  public void DrawArc (Pen pen,Rectangle rect,float startAngle, float sweepAngle)  //由Rectangle结构指定的椭圆的一部分

  

  public void DrawArc (Pen pen, int x,int y,int width,int height, int startAngle,int sweepAngle)

  

实现代码:

        private void button1_Click(object sender, EventArgs e)
        {
            Graphics g = this.CreateGraphics();
            Pen p = new Pen(Color.DarkBlue,3);
            Rectangle r=new Rectangle(30,20,200,140);
            g.DrawRectangle(new Pen(Color.Green,1),r); 
            g.DrawArc(p,r,90,180);
        }
原文地址:https://www.cnblogs.com/feiyucha/p/10257444.html