語言

Graphics.FillPie 方法

定義

填充由一對座標、寬度、高度及兩條徑向線定義的橢圓所定義的圓餅截面內部。

多載

名稱 Description
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
來源:
Graphics.cs
來源:
Graphics.cs
來源:
Graphics.cs
來源:
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 軸順時針測量到 pie 區塊的第一側。

sweepAngle
Single

角度(度數)從 startAngle 參數順時針測量到餅面第二側。

例外狀況

brush 是 null。

範例

以下程式碼範例是為 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

備註

此方法填滿由橢圓弧與兩條與弧端點相交的徑向直線所定義的圓餅截面內部。橢圓由包圍矩形定義。 圓餅截面由兩條由 startAngle 參數 sweepAngle 定義的徑向直線,以及這兩條徑向線與橢圓交點之間的弧線組成。

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

適用於

FillPie(Brush, RectangleF, Single, Single)

來源:
Graphics.cs
來源:
Graphics.cs
來源:
Graphics.cs
來源:
Graphics.cs
來源:
Graphics.cs
來源:
Graphics.cs
來源:
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 軸順時針測量到 pie 區塊的第一側。

sweepAngle
Single

角度(度數)從 startAngle 參數順時針測量到餅面第二側。

適用於

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

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

定義圓餅截面所出橢圓的邊界矩形左上角的 y 座標。

width
Int32

定義圓餅截面所出橢圓的邊界矩形寬度。

height
Int32

定義圓餅區塊所出橢圓的邊界矩形高度。

startAngle
Int32

角度(度數)從 x 軸順時針測量到 pie 區塊的第一側。

sweepAngle
Int32

角度(度數)從 startAngle 參數順時針測量到餅面第二側。

例外狀況

brush 是 null。

範例

以下程式碼範例是為 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

備註

此方法填滿由橢圓弧與兩條與弧端點相交的徑向直線所定義的圓餅截面內部。橢圓由包圍矩形定義。 圓餅截面由兩條由 startAngle 參數 sweepAngle 定義的徑向直線,以及這兩條徑向線與橢圓交點之間的弧線組成。

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

適用於

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

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

定義圓餅截面所出橢圓的邊界矩形左上角的 y 座標。

width
Single

定義圓餅截面所出橢圓的邊界矩形寬度。

height
Single

定義圓餅區塊所出橢圓的邊界矩形高度。

startAngle
Single

角度(度數)從 x 軸順時針測量到 pie 區塊的第一側。

sweepAngle
Single

角度(度數)從 startAngle 參數順時針測量到餅面第二側。

例外狀況

brush 是 null。

範例

以下程式碼範例是為 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

備註

此方法填滿由橢圓弧與兩條與弧端點相交的徑向直線所定義的圓餅截面內部。橢圓由包圍矩形定義。 圓餅截面由兩條由startAnglesweepAngle參數和參數定義的徑向線,以及這兩條徑向線與橢圓交點之間的弧線組成。

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

適用於