語言

GraphicsPath.AddPie 方法

定義

在這條路徑上加上一個圓餅形狀的輪廓。

多載

名稱 Description
AddPie(Rectangle, Single, Single)

在這條路徑上加上一個圓餅形狀的輪廓。

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

在這條路徑上加上一個圓餅形狀的輪廓。

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

在這條路徑上加上一個圓餅形狀的輪廓。

AddPie(Rectangle, Single, Single)

來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
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

A Rectangle 代表定義圓餅繪製的橢圓的邊界矩形。

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)

來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
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 Forms 設計,並需要 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 軸順時針測量)開始,結束於startAngle + sweepAngle 。

適用於

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

來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
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 軸順時針測量)開始,結束於startAngle + sweepAngle 。

適用於