用到函数DrawPie

DrawPie(Pen,Rectangle,Single,Single)

DrawPie(Pen,RectangleF,Single,Single)

DrawPie(Pen,Int32,Int32,Int32,Int32,Int32,Int32,Int32)

DrawPie(Pen,Single,Single,Single,Single,Single,Single)
private void Form1_Paint(object sender, PaintEventArgs e)
{    
    //创建画板从Paint事件中的直接引用Graphics对象
    Graphics graphics = e.Graphics;

    graphics.Clear(Color.Black);

    //定义画笔
    Pen pen = new Pen(Color.White, 3.0f);
    Pen thickPen = new Pen(Color.White,2.0f);
    Pen thick = new Pen(Color.Red, 2.0f);

    //定义扇形所属椭圆的矩形
    Rectangle rect = new Rectangle(100,100,200,200);

    graphics.DrawPie(pen, rect, -60, -60);

}

效果

七、使用GDI+画扇形

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-01
  • 2021-11-12
  • 2021-11-07
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-24
  • 2022-12-23
  • 2021-12-06
  • 2022-12-23
  • 2021-08-03
  • 2021-05-23
相关资源
相似解决方案