drawEllipse

drawEllipse(x1:    Real;
            y1:    Real;
            x2:    Real;
            y2:    Real;
            color: Integer);

The drawEllipse method of the Window class draws an ellipse on a form or control using a colored pen the width of the drawWidth property, the style of the drawStyle property, and the mode of the drawMode property. If this method is not called from a paint event, set the autoRedraw property to true.

The figure is filled using the color and style of the drawFillColor and drawFillStyle properties of the object. The drawEllipse method parameters are listed in the following table.

Parameter Description
x1, y1 Left and top points of the rectangle bounding the ellipse
x2, y2 Right and bottom points of the rectangle bounding the ellipse
color Color of the pen used

The position units of the parameters are Real primitive type values in the units of the scaleMode property of the form or control.

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

The figure drawn by this method extends up to but does not include the right and bottom coordinates. This means that the height of the figure is y2 through y1, and the width is x2 through x1.

The width and the height of a rectangle must be in the range 2 units through 32,767 units. To draw an unfilled ellipse, set the drawFillStyle property to DrawFillStyle_Transparent (1).

The code fragment in the following example shows the use of the drawEllipse method.

table.drawEllipse(20, 20, 50, 60, Red);