GraphicsPath::AddEllipse(INT,INT,INT,INT) method (gdipluspath.h)

The GraphicsPath::AddEllipse method adds an ellipse to this path.

Syntax

Status AddEllipse(
  [in] INT x,
  [in] INT y,
  [in] INT width,
  [in] INT height
);

Parameters

[in] x

Type: INT

Integer that specifies the x-coordinate of the upper-left corner of the bounding rectangle for the ellipse.

[in] y

Type: INT

Integer that specifies the y-coordinate of the upper-left corner of the bounding rectangle for the ellipse.

[in] width

Type: INT

Integer that specifies the width of the bounding rectangle for the ellipse.

[in] height

Type: INT

Integer that specifies the height of the bounding rectangle for the ellipse.

Return value

Type: Status

If the method succeeds, it returns Ok, which is an element of the Status enumeration.

If the method fails, it returns one of the other elements of the Status enumeration.

Remarks

A GraphicsPath object stores an ellipse as a sequence of four connected Bézier splines. The GraphicsPath object does not store the upper-left corner, width, and height of the ellipse's bounding rectangle.

Examples

The following example creates a GraphicsPath object path, adds an ellipse to path, and then draws path.

VOID Example_AddEllipse(HDC hdc)
{
   Graphics graphics(hdc); 

   GraphicsPath path;
   path.AddEllipse(20, 20, 200, 100);

   // Draw the path.
   Pen pen(Color(255, 255, 0, 0));
   graphics.DrawPath(&pen, &path);
}

Requirements

Requirement Value
Minimum supported client Windows XP, Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header gdipluspath.h (include Gdiplus.h)
Library Gdiplus.lib
DLL Gdiplus.dll

See also

AddArc Methods

AddEllipse Methods

Clipping with a Region

Constructing and Drawing Paths

Creating a Path Gradient

Ellipses and Arcs

GraphicsPath

Paths