Ellipse

2.x

  BOOL Ellipse(hdc, nLeftRect, nTopRect, nRightRect, nBottomRect)    
  HDC hdc; /* handle of device context */
  int nLeftRect; /* x-coordinate upper-left corner bounding rectangle */
  int nTopRect; /* y-coordinate upper-left corner bounding rectangle */
  int nRightRect; /* x-coordinate lower-right corner bounding rectangle */
  int nBottomRect; /* y-coordinate lower-right corner bounding rectangle */

The Ellipse function draws an ellipse. The center of the ellipse is the center of the specified bounding rectangle. The ellipse is drawn by using the current pen, and its interior is filled by using the current brush.

If either the width or the height of the bounding rectangle is zero, the function does not draw the ellipse.

Parameters

hdc

Identifies the device context.

nLeftRect

Specifies the logical x-coordinate of the upper-left corner of the bounding rectangle.

nTopRect

Specifies the logical y-coordinate of the upper-left corner of the bounding rectangle.

nRightRect

Specifies the logical x-coordinate of the lower-right corner of the bounding rectangle.

nBottomRect

Specifies the logical y-coordinate of the lower-right corner of the bounding rectangle.

Return Value

The return value is nonzero if the function is successful. Otherwise, it is zero.

Comments

The figure drawn by this function extends up to but does not include the right and bottom coordinates. This means that the height of the figure is determined as follows:

nBottomRectnTopRect

Similarly, the width of the figure is determined as follows:

nRightRectnLeftRect

Both the width and the height of a rectangle must be greater than 2 units and less than 32,767 units.

See Also

Arc, Chord