Draws an ellipse.
Ellipse x, y, rx, ry [,w1, w2]
PEllipse x, y, rx, ry [,w1, w2]
x, y, rx, ry, w1, w2 : single exp
Ellipse x, y, rx, ry[,w1,w2] draws an ellipse with the horizontal radius rx and the vertical radius ry, around the centre point with coordinates x and y. In addition, by using the start (w1) and end (w2) angles, you can draw just an arc rather than the full ellipse - the angles w1 and w2 are given in whole degree steps as per Figure 1, with any arc being drawn in an anti-clockwise direction.
The width of the line drawn depends on the setting of the DefLine command, while the way a line or box is drawn on the background depends on the setting of the DrawMode and BkColor properties.
The PEllipse command acts very much the same, except that the ellipses drawn are filled with a pattern defined using Deffill.
OpenW 1
Ellipse 100, 100, 40, 20, 90, 180 // Draws a quarter arc...
DefLine 0, 10
Ellipse 100, 100, 80, 40 // ...inside a full ellipse.
DefLine 0, 1 : DefFill 5
PEllipse 100, 200, 80, 40 // Draws a filled ellipse...
DefLine 2 : DefFill 48
PEllipse 100, 200, 80, 40, 45, 90 // ...with a pie section.
The current scaling depends of the form's ScaleMode setting.
The Ellipse and PEllipse commands use the old GDI library. For a smoother ellipse drawn using anti-aliasing, you can use Windows GDI+ library instead.
Note: When the radius r is declared as a Byte or Short/Word the ellipse isn't drawn; this can be got around by using CSng(r). Double, Int32 and Int64 variables are unaffected.
{Created by Sjouke Hamstra; Last updated: 17/12/2015 by James Gaite}