Graphics.FillPie 方法

定義

填滿由座標對、寬度、高度和兩條放射線指定的橢圓形所定義的派形區域內部。

多載

FillPie(Brush, Rectangle, Single, Single)

填滿由 RectangleF 結構和兩條放射線指定的橢圓形所定義的派形區段的內部。

FillPie(Brush, RectangleF, Single, Single)

填滿橢圓形和兩條星形線所定義的餅圖區段內部。

FillPie(Brush, Int32, Int32, Int32, Int32, Int32, Int32)

填滿由座標對、寬度、高度和兩條放射線指定的橢圓形所定義的派形區域內部。

FillPie(Brush, Single, Single, Single, Single, Single, Single)

填滿由座標對、寬度、高度和兩條放射線指定的橢圓形所定義的派形區域內部。

FillPie(Brush, Rectangle, Single, Single)

來源:
Graphics.cs
來源:
Graphics.cs
來源:
Graphics.cs

填滿由 RectangleF 結構和兩條放射線指定的橢圓形所定義的派形區段的內部。

public:
 void FillPie(System::Drawing::Brush ^ brush, System::Drawing::Rectangle rect, float startAngle, float sweepAngle);
public void FillPie (System.Drawing.Brush brush, System.Drawing.Rectangle rect, float startAngle, float sweepAngle);
member this.FillPie : System.Drawing.Brush * System.Drawing.Rectangle * single * single -> unit
Public Sub FillPie (brush As Brush, rect As Rectangle, startAngle As Single, sweepAngle As Single)

參數

brush
Brush

Brush,決定填滿的特性。

rect
Rectangle

Rectangle 結構,表示定義派形區段的來源橢圓形之周框。

startAngle
Single

以度為單位,依順時針方向測量之從 X 軸到派形區段的第一個邊的角度。

sweepAngle
Single

以度為單位,依順時針方向從 startAngle 參數到派形區段的第二個邊的角度。

例外狀況

brushnull

範例

下列程式代碼範例是設計來搭配 Windows Forms 使用,而且需要 PaintEventArgse,這是事件處理程序的參數Paint。 此程式碼會執行下列動作:

  • 建立實心紅色筆刷。

  • 建立限定橢圓形的矩形。

  • 定義相對於 x 軸) 的開始角度 (,並以順時針方向) 兩者 (掃掠角度。

  • 填滿螢幕上橢圓形的餅形區域。

public:
   void FillPieRectangle( PaintEventArgs^ e )
   {
      // Create solid brush.
      SolidBrush^ redBrush = gcnew SolidBrush( Color::Red );

      // Create rectangle for ellipse.
      Rectangle rect = Rectangle(0,0,200,100);

      // Create start and sweep angles.
      float startAngle = 0.0F;
      float sweepAngle = 45.0F;

      // Fill pie to screen.
      e->Graphics->FillPie( redBrush, rect, startAngle, sweepAngle );
   }
public void FillPieRectangle(PaintEventArgs e)
{
             
    // Create solid brush.
    SolidBrush redBrush = new SolidBrush(Color.Red);
             
    // Create rectangle for ellipse.
    Rectangle rect = new Rectangle(0, 0, 200, 100);
             
    // Create start and sweep angles.
    float startAngle =  0.0F;
    float sweepAngle = 45.0F;
             
    // Fill pie to screen.
    e.Graphics.FillPie(redBrush, rect, startAngle, sweepAngle);
}
Public Sub FillPieRectangle(ByVal e As PaintEventArgs)

    ' Create solid brush.
    Dim redBrush As New SolidBrush(Color.Red)

    ' Create rectangle for ellipse.
    Dim rect As New Rectangle(0, 0, 200, 100)

    ' Create start and sweep angles.
    Dim startAngle As Single = 0.0F
    Dim sweepAngle As Single = 45.0F

    ' Fill pie to screen.
    e.Graphics.FillPie(redBrush, rect, startAngle, sweepAngle)
End Sub

備註

這個方法會填滿橢圓形弧線所定義的餅圖區段內部,以及與弧線端點交集的兩條星形線。橢圓形是由周框所定義。 餅圖區段是由 和 sweepAngle 參數所startAngle定義的兩條星形線所組成,以及這些星形線與橢圓形線交集之間的弧線。

sweepAngle如果 參數大於 360 度或小於 -360 度,則會分別視為 360 度或 -360 度。

適用於

FillPie(Brush, RectangleF, Single, Single)

來源:
Graphics.cs
來源:
Graphics.cs
來源:
Graphics.cs

填滿橢圓形和兩條星形線所定義的餅圖區段內部。

public:
 void FillPie(System::Drawing::Brush ^ brush, System::Drawing::RectangleF rect, float startAngle, float sweepAngle);
public void FillPie (System.Drawing.Brush brush, System.Drawing.RectangleF rect, float startAngle, float sweepAngle);
member this.FillPie : System.Drawing.Brush * System.Drawing.RectangleF * single * single -> unit
Public Sub FillPie (brush As Brush, rect As RectangleF, startAngle As Single, sweepAngle As Single)

參數

brush
Brush

決定填滿特性的筆刷。

rect
RectangleF

周框,定義餅圖區段的來源橢圓形。

startAngle
Single

以度為單位,依順時針方向測量之從 X 軸到派形區段的第一個邊的角度。

sweepAngle
Single

以度為單位,依順時針方向從 startAngle 參數到派形區段的第二個邊的角度。

適用於

FillPie(Brush, Int32, Int32, Int32, Int32, Int32, Int32)

來源:
Graphics.cs
來源:
Graphics.cs
來源:
Graphics.cs

填滿由座標對、寬度、高度和兩條放射線指定的橢圓形所定義的派形區域內部。

public:
 void FillPie(System::Drawing::Brush ^ brush, int x, int y, int width, int height, int startAngle, int sweepAngle);
public void FillPie (System.Drawing.Brush brush, int x, int y, int width, int height, int startAngle, int sweepAngle);
member this.FillPie : System.Drawing.Brush * int * int * int * int * int * int -> unit
Public Sub FillPie (brush As Brush, x As Integer, y As Integer, width As Integer, height As Integer, startAngle As Integer, sweepAngle As Integer)

參數

brush
Brush

Brush,決定填滿的特性。

x
Int32

周框左上角的 X 座標,這個周框定義派形區段的來源橢圓形。

y
Int32

周框左上角的 X 座標,這個周框定義派形區段的來源橢圓形。

width
Int32

周框的寬度,這個周框定義派形區段的來源橢圓形。

height
Int32

周框的高度,這個周框定義派形區段的來源橢圓形。

startAngle
Int32

以度為單位,依順時針方向測量之從 X 軸到派形區段的第一個邊的角度。

sweepAngle
Int32

以度為單位,依順時針方向從 startAngle 參數到派形區段的第二個邊的角度。

例外狀況

brushnull

範例

下列程式代碼範例是設計來搭配 Windows Forms 使用,而且需要 PaintEventArgse,這是事件處理程序的參數Paint。 此程式碼會執行下列動作:

  • 建立實心紅色筆刷。

  • 建立限定橢圓形之矩形的位置和大小。

  • 定義相對於 x 軸) 的開始角度 (,並以順時針方向) 兩者 (掃掠角度。

  • 填滿螢幕上橢圓形的餅形區域。

public:
   void FillPieInt( PaintEventArgs^ e )
   {
      // Create solid brush.
      SolidBrush^ redBrush = gcnew SolidBrush( Color::Red );

      // Create location and size of ellipse.
      int x = 0;
      int y = 0;
      int width = 200;
      int height = 100;

      // Create start and sweep angles.
      int startAngle = 0;
      int sweepAngle = 45;
      
      // Fill pie to screen.
      e->Graphics->FillPie( redBrush, x, y, width, height, startAngle, sweepAngle );
   }
public void FillPieInt(PaintEventArgs e)
{
             
    // Create solid brush.
    SolidBrush redBrush = new SolidBrush(Color.Red);
             
    // Create location and size of ellipse.
    int x = 0;
    int y = 0;
    int width = 200;
    int height = 100;
             
    // Create start and sweep angles.
    int startAngle =  0;
    int sweepAngle = 45;
             
    // Fill pie to screen.
    e.Graphics.FillPie(redBrush, x, y, width, height, startAngle, sweepAngle);
}
Public Sub FillPieInt(ByVal e As PaintEventArgs)

    ' Create solid brush.
    Dim redBrush As New SolidBrush(Color.Red)

    ' Create location and size of ellipse.
    Dim x As Integer = 0
    Dim y As Integer = 0
    Dim width As Integer = 200
    Dim height As Integer = 100

    ' Create start and sweep angles.
    Dim startAngle As Integer = 0
    Dim sweepAngle As Integer = 45

    ' Fill pie to screen.
    e.Graphics.FillPie(redBrush, x, y, width, height, startAngle, _
    sweepAngle)
End Sub

備註

這個方法會填滿橢圓形弧線所定義的餅圖區段內部,以及與弧線端點交集的兩條星形線。橢圓形是由周框所定義。 餅圖區段是由 和 sweepAngle 參數所startAngle定義的兩條星形線所組成,以及這些星形線與橢圓形線交集之間的弧線。

sweepAngle如果 參數大於 360 度或小於 -360 度,則會分別視為 360 度或 -360 度。

適用於

FillPie(Brush, Single, Single, Single, Single, Single, Single)

來源:
Graphics.cs
來源:
Graphics.cs
來源:
Graphics.cs

填滿由座標對、寬度、高度和兩條放射線指定的橢圓形所定義的派形區域內部。

public:
 void FillPie(System::Drawing::Brush ^ brush, float x, float y, float width, float height, float startAngle, float sweepAngle);
public void FillPie (System.Drawing.Brush brush, float x, float y, float width, float height, float startAngle, float sweepAngle);
member this.FillPie : System.Drawing.Brush * single * single * single * single * single * single -> unit
Public Sub FillPie (brush As Brush, x As Single, y As Single, width As Single, height As Single, startAngle As Single, sweepAngle As Single)

參數

brush
Brush

Brush,決定填滿的特性。

x
Single

周框左上角的 X 座標,這個周框定義派形區段的來源橢圓形。

y
Single

周框左上角的 X 座標,這個周框定義派形區段的來源橢圓形。

width
Single

周框的寬度,這個周框定義派形區段的來源橢圓形。

height
Single

周框的高度,這個周框定義派形區段的來源橢圓形。

startAngle
Single

以度為單位,依順時針方向測量之從 X 軸到派形區段的第一個邊的角度。

sweepAngle
Single

以度為單位,依順時針方向從 startAngle 參數到派形區段的第二個邊的角度。

例外狀況

brushnull

範例

下列程式代碼範例是設計來搭配 Windows Forms 使用,而且需要 PaintEventArgse,這是事件處理程序的參數Paint。 此程式碼會執行下列動作:

  • 建立實心紅色筆刷。

  • 建立限定橢圓形之矩形的位置和大小。

  • 定義相對於 x 軸) 的開始角度 (,並以順時針方向) 兩者 (掃掠角度。

  • 填滿螢幕上橢圓形的餅形區域。

public:
   void FillPieFloat( PaintEventArgs^ e )
   {
      // Create solid brush.
      SolidBrush^ redBrush = gcnew SolidBrush( Color::Red );

      // Create location and size of ellipse.
      float x = 0.0F;
      float y = 0.0F;
      float width = 200.0F;
      float height = 100.0F;

      // Create start and sweep angles.
      float startAngle = 0.0F;
      float sweepAngle = 45.0F;

      // Fill pie to screen.
      e->Graphics->FillPie( redBrush, x, y, width, height, startAngle, sweepAngle );
   }
public void FillPieFloat(PaintEventArgs e)
{
             
    // Create solid brush.
    SolidBrush redBrush = new SolidBrush(Color.Red);
             
    // Create location and size of ellipse.
    float x = 0.0F;
    float y = 0.0F;
    float width = 200.0F;
    float height = 100.0F;
             
    // Create start and sweep angles.
    float startAngle =  0.0F;
    float sweepAngle = 45.0F;
             
    // Fill pie to screen.
    e.Graphics.FillPie(redBrush, x, y, width, height, startAngle, sweepAngle);
}
Public Sub FillPieFloat(ByVal e As PaintEventArgs)

    ' Create solid brush.
    Dim redBrush As New SolidBrush(Color.Red)

    ' Create location and size of ellipse.
    Dim x As Single = 0.0F
    Dim y As Single = 0.0F
    Dim width As Single = 200.0F
    Dim height As Single = 100.0F

    ' Create start and sweep angles.
    Dim startAngle As Single = 0.0F
    Dim sweepAngle As Single = 45.0F

    ' Fill pie to screen.
    e.Graphics.FillPie(redBrush, x, y, width, height, startAngle, _
    sweepAngle)
End Sub

備註

這個方法會填滿橢圓形弧線所定義的餅圖區段內部,以及與弧線端點交集的兩條星形線。橢圓形是由周框所定義。 餅圖區段是由 和 sweepAngle 參數所startAngle定義的兩條星形線所組成,以及這些星形線與橢圓形線交集之間的弧線。

sweepAngle如果 參數大於 360 度或小於 -360 度,則會分別視為 360 度或 -360 度。

適用於