This documentation is for the old version. Go to the latest Graphics Mill docs

GdiGraphics.DrawEllipse Method (Pen, Single, Single, Single, Single)

Draws an ellipse.

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

Syntax

Visual Basic
Public Sub DrawEllipse ( _
	pen As Pen, _
	x As Single, _
	y As Single, _
	width As Single, _
	height As Single _
)
C#
public void DrawEllipse(
	Pen pen,
	float x,
	float y,
	float width,
	float height
)

Parameters

pen

Type: Aurigma.GraphicsMill.Drawing.Pen

Pen object which is used to outline an ellipse.
x

Type: System.Single

X-coordinate of the top left corner of the bounding rectangle for the ellipse.
y

Type: System.Single

Y-coordinate of the top left corner of the bounding rectangle for the ellipse.
width

Type: System.Single

Width of the bounding rectangle for the ellipse.
height

Type: System.Single

Height of the bounding rectangle for the ellipse.

Remarks

Ellipse is defined by its tightest bounding rectangle. If you have an ellipse defined with central point and two radiuses, you can convert these parameters to rectangle in the following way:
C#

// Let's assume we have centerX, centerY - coordinates of the ellipse center, 
// horizontalRadius and verticalRadius - radiuses of the ellipse.
// We are calculating rectX, rectY, rectWidth, and rectHeight which specify 
// bounding rectangle for ellipse.

rectX = centerX - horizontalRadius;
rectY = centerY - verticalRadius;
rectWidth = horizontalRadius * 2;
rectHeight = verticalRadius * 2;

All the coordinates are measured in units specified with Unit property.

To fill an ellipse, use FillEllipse(Brush, Single, Single, Single, Single) method.

See Also

Reference