Graphics.FillEllipse Method (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.

Namespace: Aurigma.GraphicsMill.Drawing
Assembly: Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)

Syntax

C#
public void FillEllipse(
	Brush brush,
	int x,
	int y,
	int width,
	int height
)

Parameters

brush

Type: Aurigma.GraphicsMill.Drawing.Brush

A Brush that determines the characteristics of the fill.
x

Type: System.Int32

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

Type: System.Int32

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

Type: System.Int32

The width of the bounding rectangle that defines the ellipse.
height

Type: System.Int32

The height of the bounding rectangle that defines the ellipse.

Remarks

Ellipse is defined by its tightest bounding rectangle.

To outline an ellipse, use DrawEllipse(Pen, Int32, Int32, Int32, Int32) method.

Examples

C#
using (var bitmap = new Bitmap(185, 145, PixelFormat.Format24bppRgb, RgbColor.White))
{
    using (Graphics graphics = bitmap.GetGraphics())
    {
        //Draw filled and outlined rectangle
        var pen = new Pen(RgbColor.Red, 3);
        var brush = new SolidBrush(RgbColor.Lavender);
        graphics.FillRectangle(brush, 10, 10, 100, 60);
        graphics.DrawRectangle(pen, 10, 10, 100, 60);

        //Draw filled but non-outlined ellipse
        brush.Color = RgbColor.Yellow;
        graphics.FillEllipse(brush, 60, 40, 100, 80);

        //Draw outlined but non-filled polygon 
        pen.Color = RgbColor.Green;
        pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot;
        pen.Width = 2;
        System.Drawing.Point[] points = { 
            new System.Drawing.Point(20, 30), new System.Drawing.Point(50, 2), 
            new System.Drawing.Point(180, 30), new System.Drawing.Point(80, 140)
        };
        graphics.DrawPolygon(pen, points);
    }
    bitmap.Save(@"Images\Output\shapesGDI.png");
}

See Also

Reference