Graphics::DrawEllipse(constPen*,constRectF&) method (gdiplusgraphics.h)

The Graphics::DrawEllipse method draws an ellipse.

Syntax

Status DrawEllipse(
  const Pen     *pen,
  const RectF & rect
);

Parameters

pen

Pointer to a pen that is used to draw the ellipse.

rect

Reference to a rectangle that bounds the ellipse.

Return value

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

Examples

The following example draws an ellipse.

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

   // Create a Pen object.
   Pen bluePen(Color(255, 0, 0, 255));

   // Create a Rect object that bounds the ellipse.
   RectF ellipseRect(0.0f, 0.0f, 200.0f, 100.0f);

   // Draw the ellipse.
   graphics.DrawEllipse(&bluePen, ellipseRect);
}

Requirements

Requirement Value
Header gdiplusgraphics.h

See also

Graphics

FillEllipse Methods

Pen

RectF

Ellipses and Arcs