BB___PIE

=PIE= toc

Description
> For use with graphics windows and graphicboxes, PIE draws the outline of a pie slice shape using the pen position as the vertex of the slice. The slice is inscribed within an ellipse 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
> The angle of the slice is measured in degrees. angle1 is the beginning angle based on north being 270 degrees, and angle2 is the number of degrees of sweep. Positive angles sweep clockwise and negative angles sweep counter-clockwise.

To illustrate the angles, suppose you wanted to draw a sweep from 12:00 on the clock face to 1:30. angle1 would be 270 and angle2 would be 45. > code format="lb" code
 * 1) handle.ext "pie 100 50 270 45"

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 in a graphics window. code format="lb" nomainwin

WindowWidth=400 WindowHeight=300

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

'put the pen down #g "down; place 100 100" 'draw an ellipse #g "color lightgray; ellipse 100 80"

'draw a pie shape beginning at 3:00 on clockface and 'ending thru a sweep of 112 degrees #g "color black; size 2" #g "pie 100 80 0 112"

'make graphics stick #g "flush"

wait

[quit] close #g end code

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

WindowWidth=400 WindowHeight=300

graphicbox #g.gb 0, 0, 390, 270 open "Pie Demo" for graphics_nsb_nf as #g #g "trapclose [quit]"

'put the pen down #g.gb "down; place 100 100" 'draw an ellipse #g.gb "color lightgray; ellipse 100 100"

'draw a pie shape beginning at 3:00 on clockface and 'ending thru a sweep of 112 degrees #g.gb "color black; size 2" #g.gb "pie 100 100 10 350"

'make graphics stick #g.gb "flush"

wait

[quit] close #g end code

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