GraphicsPath.AddPie 方法

定义

向此路径添加一个扇形轮廓。

重载

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

向此路径添加一个扇形轮廓。

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 -> unit
Public Sub AddPie (rect As Rectangle, startAngle As Single, sweepAngle As Single)

参数

rect
Rectangle

一个 Rectangle,表示定义要从其绘制扇形的椭圆的边框。

startAngle
Single

扇形区的起始角度,以度为单位从 X 轴顺时针测量。

sweepAngle
Single

startAngle 与扇形区末尾之间的角度,以度为单位从 startAngle 顺时针测量。

示例

有关示例,请参见 AddPie(Int32, Int32, Int32, Int32, Single, Single)

注解

饼图由椭圆的部分轮廓和与部分轮廓端点相交的两条径向线定义。 部分轮廓从 startAngle x 轴) 顺时针 (开始,结束于 + startAnglesweepAngle

适用于

AddPie(Int32, Int32, Int32, Int32, Single, Single)

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 -> unit
Public 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 窗体 一起使用,它需要 PaintEventArgse事件OnPaint对象。 代码创建图形路径,添加饼图形状,然后将路径绘制到屏幕。

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 轴) 顺时针 (开始,结束于 + startAnglesweepAngle

适用于

AddPie(Single, Single, Single, Single, Single, Single)

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 -> unit
Public 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 轴) 顺时针 (开始,结束于 + startAnglesweepAngle

适用于