Graphics.FillEllipse 方法

定義

填滿由一對座標、寬度和高度所指定的周框所定義的橢圓內部。

多載

FillEllipse(Brush, Rectangle)

填滿由 Rectangle 結構所指定周框所定義的橢圓形內部。

FillEllipse(Brush, RectangleF)

填滿由 RectangleF 結構所指定周框所定義的橢圓形內部。

FillEllipse(Brush, Int32, Int32, Int32, Int32)

填滿由一對座標、寬度和高度所指定的周框所定義的橢圓內部。

FillEllipse(Brush, Single, Single, Single, Single)

填滿由一對座標、寬度和高度所指定的周框所定義的橢圓內部。

FillEllipse(Brush, Rectangle)

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

填滿由 Rectangle 結構所指定周框所定義的橢圓形內部。

public void FillEllipse(System.Drawing.Brush brush, System.Drawing.Rectangle rect);

參數

brush
Brush

決定填滿特性的 Brush

rect
Rectangle

Rectangle 結構,表示定義橢圓形的周框。

例外狀況

brush null

範例

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

  • 建立純紅色筆刷。

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

  • 填滿畫面上的省略號。

public void FillEllipseRectangle(PaintEventArgs e)
{
             
    // Create solid brush.
    SolidBrush redBrush = new SolidBrush(Color.Red);
             
    // Create rectangle for ellipse.
    int x = 0;
    int y = 0;
    int width = 200;
    int height = 100;
    Rectangle rect = new Rectangle(x, y, width, height);
             
    // Fill ellipse on screen.
    e.Graphics.FillEllipse(redBrush, rect);
}

備註

這個方法會將省略號的內部填入 Brush。 省略號是由 rect 參數所代表的周框所定義。

適用於

.NET 10 (package-provided) 及其他版本
產品 版本
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

FillEllipse(Brush, RectangleF)

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

填滿由 RectangleF 結構所指定周框所定義的橢圓形內部。

public void FillEllipse(System.Drawing.Brush brush, System.Drawing.RectangleF rect);

參數

brush
Brush

決定填滿特性的 Brush

rect
RectangleF

RectangleF 結構,表示定義橢圓形的周框。

例外狀況

brush null

範例

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

  • 建立純紅色筆刷。

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

  • 填滿畫面上的省略號。

public void FillEllipseRectangleF(PaintEventArgs e)
{
             
    // Create solid brush.
    SolidBrush redBrush = new SolidBrush(Color.Red);
             
    // Create rectangle for ellipse.
    float x = 0.0F;
    float y = 0.0F;
    float width = 200.0F;
    float height = 100.0F;
    RectangleF rect = new RectangleF(x, y, width, height);
             
    // Fill ellipse on screen.
    e.Graphics.FillEllipse(redBrush, rect);
}

備註

這個方法會將省略號的內部填入 Brush。 省略號是由 rect 參數所代表的周框所定義。

適用於

.NET 10 (package-provided) 及其他版本
產品 版本
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

FillEllipse(Brush, Int32, Int32, Int32, Int32)

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

填滿由一對座標、寬度和高度所指定的周框所定義的橢圓內部。

public void FillEllipse(System.Drawing.Brush brush, int x, int y, int width, int height);

參數

brush
Brush

決定填滿特性的 Brush

x
Int32

定義橢圓形之周框左上角的 X 座標。

y
Int32

定義橢圓形之周框左上角的 Y 座標。

width
Int32

定義橢圓形的周框寬度。

height
Int32

定義橢圓形的周框高度。

例外狀況

brush null

範例

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

  • 建立純紅色筆刷。

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

  • 填滿畫面上的省略號。

public void FillEllipseInt(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;
             
    // Fill ellipse on screen.
    e.Graphics.FillEllipse(redBrush, x, y, width, height);
}

備註

這個方法會將省略號的內部填入 Brush。 橢圓形是由 xywidthheight 參數所代表的周框所定義。

適用於

.NET 10 (package-provided) 及其他版本
產品 版本
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

FillEllipse(Brush, Single, Single, Single, Single)

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

填滿由一對座標、寬度和高度所指定的周框所定義的橢圓內部。

public void FillEllipse(System.Drawing.Brush brush, float x, float y, float width, float height);

參數

brush
Brush

決定填滿特性的 Brush

x
Single

定義橢圓形之周框左上角的 X 座標。

y
Single

定義橢圓形之周框左上角的 Y 座標。

width
Single

定義橢圓形的周框寬度。

height
Single

定義橢圓形的周框高度。

例外狀況

brush null

範例

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

  • 建立純紅色筆刷。

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

  • 填滿畫面上的省略號。

public void FillEllipseFloat(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;
             
    // Fill ellipse on screen.
    e.Graphics.FillEllipse(redBrush, x, y, width, height);
}

備註

這個方法會將省略號的內部填入 Brush。 橢圓形是由 xywidthheight 參數所代表的周框所定義。

適用於

.NET 10 (package-provided) 及其他版本
產品 版本
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10