Graphics.DrawEllipse(const Pen*, const Rect) method

Applies to: desktop apps only

The Graphics::DrawEllipse method draws an ellipse.

Syntax

Status DrawEllipse(
  [in]       const Pen *pen,
  [in, ref]  const Rect &rect
);

Parameters

  • pen [in]
    Type: const Pen*

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

  • rect [in, ref]
    Type: const Rect

    Reference to a rectangle that bounds the ellipse.

Return value

Type:

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.

Examples

The following example draws an ellipse.

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

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

   // Create a Rect object that bounds the ellipse.
   Rect ellipseRect(0, 0, 200, 100);

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

Requirements

Minimum supported client

Windows XP, Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Product

GDI+ 1.0

Header

Gdiplusgraphics.h (include Gdiplus.h)

Library

Gdiplus.lib

DLL

Gdiplus.dll

See also

Graphics

FillEllipse Methods

Pen

Rect

Ellipses and Arcs

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012