CDC::Ellipse

This method draws an ellipse.

BOOL Ellipse(
int x1,
int y1,
int x2,
int y2 );

BOOL Ellipse(
LPCRECT lpRect ); 

Parameters

  • x1
    The logical x-coordinate of the upper-left corner of the bounding rectangle of the ellipse.
  • y1
    The logical y-coordinate of the upper-left corner of the bounding rectangle of the ellipse.
  • x2
    The logical x-coordinate of the lower-right corner of the bounding rectangle of the ellipse.
  • y2
    The logical y-coordinate of the lower-right corner of the bounding rectangle of the ellipse.
  • lpRect
    The bounding rectangle of the ellipse. You can also pass a CRect object for this parameter.

Return Value

Nonzero if the function is successful; otherwise, it is zero.

Remarks

The center of the ellipse is the center of the bounding rectangle specified by x1, y1, x2, and y2, or lpRect. The ellipse is drawn with the current pen, and its interior is filled with the current brush.

The figure drawn by this function extends to, but does not include, the right and bottom coordinates. This means that the height of the figure is y2y1 and the width of the figure is x2x1.

If either the width or the height of the bounding rectangle is zero, no ellipse is drawn.

Requirements

**  Windows CE versions:** 1.0 and later
  Header file: Declared in Afxwin.h
  Platform: H/PC Pro, Palm-size PC, Pocket PC