BB___ELLIPSE

=ELLIPSE= toc

Description
> For use with graphics windows and graphicboxes, ELLIPSE draws the outline of an ellipse shape centered at the pen position and w wide by h high.

> There are five graphics commands that draw shapes: >> box >> circle >> ellipse >> line >> pie

Syntax
> //This command is NOT case sensitive.//

Using literal values

 * 1)  - a graphics window
 * 2)  - a graphicbox

Using variable values
> and  are the width and height of the ellipse.

Hints
boxfilled circlefilled ellipsefilled piefilled
 * //**Color & Size.**// Shapes are drawn with a pen color set by the command and a line thickness set by the  command.
 * //**Filled Shapes.**// You cannot draw a shape and then it with color. (The  command is used to fill the graphics window with color). Instead, to make a shape filled with color, use the complimentary //shape//filled commands:

Example
An example of the command using a graphics window. code format="lb" nomainwin

WindowWidth=400 WindowHeight=300

open "Draw Ellipse Demo" for graphics_nsb_nf as #g #g "trapclose [quit]" 'put the pen down #g "down" 'place pen at the center of the ellipse #g "place 150 150" 'draw an ellipse 100 wide x 50 high #g "ellipse 100 50"

wait

[quit] close #g end code

An example of the command using a graphicbox. code format="lb" nomainwin

WindowWidth=400 WindowHeight=300

graphicbox #g.gb 2, 2, 390, 270 open "Draw Ellipse Demo" for graphics_nsb_nf as #g #g "trapclose [quit]" 'put the pen down #g.gb "down" 'set pen color and size for shape #g.gb "color blue; size 3" 'set a point at the center of the ellipse #g.gb "set 100 150" 'draw an ellipse 100 wide x 50 high #g.gb "ellipse 100 50"

wait

[quit] close #g end code

An example combining four shape commands in a graphics window. code format="lb" nomainwin

WindowWidth=400 WindowHeight=300

open "All Shapes Demo" for graphics_nsb_nf as #g #g "trapclose [quit]"

'put the pen down #g "down" 'set the pen color and size #g "color blue; size 2" 'place and draw a box #g "place 10 10; box 150 150" 'place and draw a circle #g "place 80 80; circle 40" 'place and draw an ellipse #g "place 200 200; ellipse 100 50" 'change pen color and size #g "color red; size 1" 'draw a line #g "line 10 10 200 200" #g "flush" 'make graphics stick wait

[quit] close #g end code

Useful Functions
code format="lb" Place a useful function using this keyword here code