pieslice function in c graphics

V7DEQYYCZD8R
pieslice function of c graphics is used to draw the circle and this circle is filled with color and/or style. In contrast of pieslice circle only draw the outline of the circle.

General syntax of pieslice function in c graphics is:
                                          pieslice(int xpos, int ypos, int sangle, int eangle, int radius); 

pieslice function takes 5 argument, all are integer datatype. First two is the center point of pieslice on X and Y coordinate respectively. Third and fourth argument is starting and ending angle of pieslice function respectively. And fifth argument is the radius of pieslice.

pieslice is fill the color and style by using setfillstyle function of c graphics.

C graphic program to demonstrate pieslice function of graphics.h
#include<graphics.h>
#include<conio.h>

main()
{
   int gd = DETECT, gm;
   initgraph(&gd, &gm, "C:\\TC\\BGI");
   setfillstyle(2,5);
   pieslice(300,250,0,160,100);
   getch();
   closegraph();
   return 0;
}
pieslice function in c graphics
Download


0 comments:

Post a Comment