Graphics.FillEllipse Method

Definition

Fills the interior of an ellipse defined by a bounding rectangle specified by a pair of coordinates, a width, and a height.

Overloads

FillEllipse(Brush, Rectangle)

Fills the interior of an ellipse defined by a bounding rectangle specified by a Rectangle structure.

FillEllipse(Brush, RectangleF)

Fills the interior of an ellipse defined by a bounding rectangle specified by a RectangleF structure.

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

Fills the interior of an ellipse defined by a bounding rectangle specified by a pair of coordinates, a width, and a height.

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

Fills the interior of an ellipse defined by a bounding rectangle specified by a pair of coordinates, a width, and a height.

FillEllipse(Brush, Rectangle)

Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs

Fills the interior of an ellipse defined by a bounding rectangle specified by a Rectangle structure.

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

Parameters

brush
Brush

Brush that determines the characteristics of the fill.

rect
Rectangle

Rectangle structure that represents the bounding rectangle that defines the ellipse.

Exceptions

brush is null.

Examples

The following code example is designed for use with Windows Forms, and it requires PaintEventArgs e, which is a parameter of the Paint event handler. The code performs the following actions:

  • Creates a solid red brush.

  • Creates a rectangle that bounds an ellipse.

  • Fills the ellipse on the screen.

C#
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);
}

Remarks

This method fills the interior of an ellipse with a Brush. The ellipse is defined by the bounding rectangle represented by the rect parameter.

Applies to

.NET 10 (package-provided) dan versi lain
Produk Versi
.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)

Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs

Fills the interior of an ellipse defined by a bounding rectangle specified by a RectangleF structure.

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

Parameters

brush
Brush

Brush that determines the characteristics of the fill.

rect
RectangleF

RectangleF structure that represents the bounding rectangle that defines the ellipse.

Exceptions

brush is null.

Examples

The following code example is designed for use with Windows Forms, and it requires PaintEventArgs e, which is a parameter of the Paint event handler. The code performs the following actions:

  • Creates a solid red brush.

  • Creates a rectangle that bounds an ellipse.

  • Fills the ellipse on the screen.

C#
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);
}

Remarks

This method fills the interior of an ellipse with a Brush. The ellipse is defined by the bounding rectangle represented by the rect parameter.

Applies to

.NET 10 (package-provided) dan versi lain
Produk Versi
.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)

Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs

Fills the interior of an ellipse defined by a bounding rectangle specified by a pair of coordinates, a width, and a height.

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

Parameters

brush
Brush

Brush that determines the characteristics of the fill.

x
Int32

The x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse.

y
Int32

The y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse.

width
Int32

Width of the bounding rectangle that defines the ellipse.

height
Int32

Height of the bounding rectangle that defines the ellipse.

Exceptions

brush is null.

Examples

The following code example is designed for use with Windows Forms, and it requires PaintEventArgs e, which is a parameter of the Paint event handler. The code performs the following actions:

  • Creates a solid red brush.

  • Creates the location and size of a rectangle that bounds an ellipse.

  • Fills the ellipse on the screen.

C#
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);
}

Remarks

This method fills the interior of an ellipse with a Brush. The ellipse is defined by the bounding rectangle represented by the x, y, width, and height parameters.

Applies to

.NET 10 (package-provided) dan versi lain
Produk Versi
.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)

Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs

Fills the interior of an ellipse defined by a bounding rectangle specified by a pair of coordinates, a width, and a height.

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

Parameters

brush
Brush

Brush that determines the characteristics of the fill.

x
Single

The x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse.

y
Single

The y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse.

width
Single

Width of the bounding rectangle that defines the ellipse.

height
Single

Height of the bounding rectangle that defines the ellipse.

Exceptions

brush is null.

Examples

The following code example is designed for use with Windows Forms, and it requires PaintEventArgs e, which is a parameter of the Paint event handler. The code performs the following actions:

  • Creates a solid red brush.

  • Creates the location and size of a rectangle that bounds an ellipse.

  • Fills the ellipse on the screen.

C#
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);
}

Remarks

This method fills the interior of an ellipse with a Brush. The ellipse is defined by the bounding rectangle represented by the x, y, width, and height parameters.

Applies to

.NET 10 (package-provided) dan versi lain
Produk Versi
.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