Borland C++ reference

pieslice

raw OCR

Draws and fills in pie slice.

Defined in header <graphics.h>

Syntax

#include <graphics.h>
void  far pieslice(int x, int y, int stangle, int endangle, int radius);

Portability

DOSUNIXWindowsANSI CC++ only
■

Remarks

pieslice draws and fills a pie slice centered at {x,y) with a radius given by radius. The slice travels from stangle to endangle. The slice is outlined in the current drawing color and then filled using the current fill pattern and fill color.

The angles for pieslice are given in degrees. They are measured counter-clockwise, with 0 degrees at 3 o'clock, 90 degrees at 12 o'clock, and so on.

b^

If you are using a CGA or monochromeadapter, the examples in this book

of how to use graphics functions may not produce the expected results. If

your system runs on a CGA or monochromeadapter, use the value 1 (one)

instead of the symbolic color constant, and consult the second example under arc on how to use the pieslice function.

Return value

None.

See also

Example

#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
int main(void)
{
   /* request autodetection  */
   int gdriver = DETECT, gmode,  errorcode;
   int midx, midy;
   int stangle = 45, endangle  = 135, radius = 100;

   /* initialize graphics and  local variables V
   initgraph(&gdriver, &gmode,  "");

   /* read result of initialization  7
   errorcode = graphresult ();
if  (errorcode != grOk)    /* an error occurred */
{
   printf( "Graphics error: %s\n", grapherrormsg(errorcode)
   printf( "Press any key to halt:");
   getch( );
   exit(l) ;               /* terminate with an error code */

midx = getmaxx () / 2;
midy = getmaxy () / 2;
/* set fill style  and draw a pie slice */
setfillstyle(EMPTY_FILL,  getmaxcolor());
pieslice (midx, midy, stangle, endangle, radius);

/* clean up  */
getch();
closegraphO  ;
return 0;

Differences from modern implementations

Nothing recorded yet.

Modern references

These are search links, not yet checked by hand.