GraphicsPath.AddPie 方法   
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
将饼图形状的轮廓添加到此路径。
重载
| AddPie(Rectangle, Single, Single) | 将饼图形状的轮廓添加到此路径。 | 
| AddPie(Int32, Int32, Int32, Int32, Single, Single) | 将饼图形状的轮廓添加到此路径。 | 
| AddPie(Single, Single, Single, Single, Single, Single) | 将饼图形状的轮廓添加到此路径。 | 
AddPie(Rectangle, Single, Single)
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
将饼图形状的轮廓添加到此路径。
public:
 void AddPie(System::Drawing::Rectangle rect, float startAngle, float sweepAngle);public void AddPie(System.Drawing.Rectangle rect, float startAngle, float sweepAngle);member this.AddPie : System.Drawing.Rectangle * single * single -> unitPublic Sub AddPie (rect As Rectangle, startAngle As Single, sweepAngle As Single)参数
- startAngle
- Single
饼图部分的起始角度,以度为单位从 x 轴顺时针测量。
- sweepAngle
- Single
              startAngle 和饼图部分的末尾之间的角度,从 startAngle顺时针以度为单位。
示例
有关示例,请参阅 AddPie(Int32, Int32, Int32, Int32, Single, Single)。
注解
饼图由椭圆的部分轮廓和与部分轮廓相交的两条径向线定义。 分部轮廓从 startAngle 开始(从 x 轴按顺时针测量),以 startAngle + sweepAngle结尾。
适用于
AddPie(Int32, Int32, Int32, Int32, Single, Single)
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
将饼图形状的轮廓添加到此路径。
public:
 void AddPie(int x, int y, int width, int height, float startAngle, float sweepAngle);public void AddPie(int x, int y, int width, int height, float startAngle, float sweepAngle);member this.AddPie : int * int * int * int * single * single -> unitPublic Sub AddPie (x As Integer, y As Integer, width As Integer, height As Integer, startAngle As Single, sweepAngle As Single)参数
- x
- Int32
边界矩形左上角的 x 坐标,用于定义从中绘制饼图的椭圆。
- y
- Int32
边界矩形左上角的 y 坐标,用于定义从中绘制饼图的椭圆。
- width
- Int32
定义从中绘制饼图的椭圆的边界矩形的宽度。
- height
- Int32
定义从中绘制饼图的椭圆的边界矩形的高度。
- startAngle
- Single
饼图部分的起始角度,以度为单位从 x 轴顺时针测量。
- sweepAngle
- Single
              startAngle 和饼图部分的末尾之间的角度,从 startAngle顺时针以度为单位。
示例
下面的代码示例旨在与 Windows 窗体一起使用,它需要 PaintEventArgseOnPaint 事件对象。 该代码创建图形路径,添加饼图形状,然后将路径绘制到屏幕。
private:
   void AddPieExample( PaintEventArgs^ e )
   {
      // Create a pie slice of a circle using the AddPie method.
      GraphicsPath^ myPath = gcnew GraphicsPath;
      myPath->AddPie( 20, 20, 70, 70, -45, 90 );
      // Draw the path to the screen.
      Pen^ myPen = gcnew Pen( Color::Black,2.0f );
      e->Graphics->DrawPath( myPen, myPath );
   }
private void AddPieExample(PaintEventArgs e)
{
             
    // Create a pie slice of a circle using the AddPie method.
    GraphicsPath myPath = new GraphicsPath();
    myPath.AddPie(20, 20, 70, 70, -45, 90);
             
    // Draw the path to the screen.
    Pen myPen = new Pen(Color.Black, 2);
    e.Graphics.DrawPath(myPen, myPath);
}
Public Sub AddPieExample(ByVal e As PaintEventArgs)
    ' Create a pie slice of a circle using the AddPie method.
    Dim myPath As New GraphicsPath
    myPath.AddPie(20, 20, 70, 70, -45, 90)
    ' Draw the path to the screen.
    Dim myPen As New Pen(Color.Black, 2)
    e.Graphics.DrawPath(myPen, myPath)
End Sub
注解
饼图由椭圆的部分轮廓和与部分轮廓相交的两条径向线定义。 分部轮廓从 startAngle 开始(从 x 轴按顺时针测量),以 startAngle + sweepAngle结尾。
适用于
AddPie(Single, Single, Single, Single, Single, Single)
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
将饼图形状的轮廓添加到此路径。
public:
 void AddPie(float x, float y, float width, float height, float startAngle, float sweepAngle);public void AddPie(float x, float y, float width, float height, float startAngle, float sweepAngle);member this.AddPie : single * single * single * single * single * single -> unitPublic Sub AddPie (x As Single, y As Single, width As Single, height As Single, startAngle As Single, sweepAngle As Single)参数
- x
- Single
边界矩形左上角的 x 坐标,用于定义从中绘制饼图的椭圆。
- y
- Single
边界矩形左上角的 y 坐标,用于定义从中绘制饼图的椭圆。
- width
- Single
定义从中绘制饼图的椭圆的边界矩形的宽度。
- height
- Single
定义从中绘制饼图的椭圆的边界矩形的高度。
- startAngle
- Single
饼图部分的起始角度,以度为单位从 x 轴顺时针测量。
- sweepAngle
- Single
              startAngle 和饼图部分的末尾之间的角度,从 startAngle顺时针以度为单位。
示例
有关示例,请参阅 AddPie(Int32, Int32, Int32, Int32, Single, Single)。
注解
饼图由椭圆的部分轮廓和与部分轮廓相交的两条径向线定义。 分部轮廓从 startAngle 开始(从 x 轴按顺时针测量),以 startAngle + sweepAngle结尾。