ELLIPSE, ELLIPSE_W

Graphics Function: Draws a circle or an ellipse using the current graphics color.

Module: USE DFLIB

Syntax

result = ELLIPSE (control, x1, y1, x2, y2)
result = ELLIPSE_W (control, wx1, wy1, wx2, wy2)


control
(Input) INTEGER(2). Fill flag. Can be one of the following symbolic constants:



x1, y1
(Input) INTEGER(2). Viewport coordinates for upper-left corner of bounding rectangle.


x2, y2
(Input) INTEGER(2). Viewport coordinates for lower-right corner of bounding rectangle.


wx1, wy1
(Input) REAL(8). Window coordinates for upper-left corner of bounding rectangle.


wx2, wy2
(Input) REAL(8). Window coordinates for lower-right corner of bounding rectangle.

Results:

The result is of type INTEGER(2). The result is nonzero if successful; otherwise, 0. If the ellipse is clipped or partially out of bounds, the ellipse is considered successfully drawn, and the return is 1. If the ellipse is drawn completely out of bounds, the return is 0.

The border is drawn in the current color and line style.

When you use ELLIPSE, the center of the ellipse is the center of the bounding rectangle defined by the viewport-coordinate points (x1, y1) and (x2, y2). When you use ELLIPSE_W, the center of the ellipse is the center of the bounding rectangle defined by the window-coordinate points (wx1, wy1) and (wx2, wy2). If the bounding-rectangle arguments define a point or a vertical or horizontal line, no figure is drawn.

The control option given by $GFILLINTERIOR is equivalent to a subsequent call to the FLOODFILLRGB function using the center of the ellipse as the start point and the current color (set by SETCOLORRGB) as the boundary color.


Note: The ELLIPSE routine described here is a QuickWin routine. If you are trying to use the Win32 SDK version of the Ellipse routine by including the DFWIN module, you need to specify the routine name as MSFWIN$Ellipse. For more information, see Special Naming Convention for Certain QuickWin and Win32 Graphics Routines in the Programmer's Guide.

Compatibility

STANDARD GRAPHICS QUICKWIN GRAPHICS LIB

See Also: ARC, FLOODFILLRGB, GRSTATUS, LINETO, PIE, POLYGON, RECTANGLE, SETCOLORRGB, SETFILLMASK

Example

This program draws the shape shown below.

! compile as QuickWin or Standard Graphics application
 USE DFLIB
 INTEGER(2) dummy, x1, y1, x2, y2
 x1 = 80;  y1 = 50
 x2 = 240; y2 = 150
 dummy = ELLIPSE( $GFILLINTERIOR, x1, y1, x2, y2 )
 END

Figure: Output of Program ELLIPSE.FOR