_ellipse Functions

Description

Draw ellipses.

#include <graph.h>

short __far _ellipse( short control, short x1, short y1, short x2, short y2 );

short __far _ellipse_w( short control, double wx1, double wy1, double wx2,
double wy2 );

short __far _ellipse_wxy( short control, struct _wxycoord __far *pwxy1,
struct _wxycoord __far *pwxy2 );

control Fill flag  
x1, y1 Upper-left corner of bounding rectangle  
x2, y2 Lower-right corner of bounding rectangle  
wx1, wy1 Upper-left corner of bounding rectangle  
wx2, wy2 Lower-right corner of bounding rectangle  
pwxy1 Upper-left corner of bounding rectangle  
pwxy2 Lower-right corner of bounding rectangle  

Remarks

The _ellipse functions draw ellipses or circles. The borders are drawn in the current color. In the _ellipse function, the center of the ellipse is the center of the bounding rectangle defined by the view-coordinate points (x1, y1) and (x2, y2).

In the _ellipse_w function, the center of the ellipse is the center of the bounding rectangle defined by the window-coordinate points (wx1, wy1) and (wx2, wy2).

In the _ellipse_wxy function, the center of the ellipse is the center of the bounding rectangle defined by the window-coordinate points (pwxy1) and (pwxy2).

If the bounding-rectangle arguments define a point or a vertical or horizontal line, no figure is drawn.

The control argument can be one of the following manifest constants:

Constant Action

_GFILLINTERIOR Uses _floodfill to fill the ellipse using the current fill mask
_GBORDER Does not fill the ellipse

The control option given by _GFILLINTERIOR is equivalent to a subsequent call to the _floodfill function, using the center of the ellipse as the starting point and the current color (set by _setcolor) as the boundary color.

Return Value

The _ellipse functions return a nonzero value if the ellipse is drawn successfully; otherwise, they return 0.

Compatibility

Standards:None

16-Bit:DOS

32-Bit:None

See Also

_arc functions, _floodfill, _grstatus, _lineto functions, _pie functions, _polygon functions, _rectangle functions, _setcolor, _setfillmask

Example

/* ELLIPSE.C: This program draws a simple ellipse. */

#include <conio.h>

#include <stdlib.h>

#include <graph.h>

void main( void )

{

/* Find a valid graphics mode. */

if( !_setvideomode( _MAXRESMODE ) )

exit( 1 );

_ellipse( _GFILLINTERIOR, 80, 50, 240, 150 );

/* Strike any key to clear screen. */

_getch();

_setvideomode( _DEFAULTMODE );

}