fillpoly function is used to draw and fill polygon. It will takes two argumnet same as drawpoly function.
General syntax of fillpoly function is :
fillpoly( int num, int *polypoint);
fillpoly function fill white color by default. To change fill color and pattern style we need to use setfillstyle function.
#include <graphics.h>
#include <stdio.h>
int main( )
{
int gd=DETECT, gm;
int points[]={150,130,350,130,350,400,250,400,150,130};
initgraph(&gd,&gm,"C:\\tc\\bgi");
fillpoly(5,points);
getch();
closegraph();
return 0;
}
General syntax of fillpoly function is :
fillpoly( int num, int *polypoint);
fillpoly function fill white color by default. To change fill color and pattern style we need to use setfillstyle function.
C graphic program to demonstrate fillpoly function.
#include <graphics.h>
#include <stdio.h>
int main( )
{
int gd=DETECT, gm;
int points[]={150,130,350,130,350,400,250,400,150,130};
initgraph(&gd,&gm,"C:\\tc\\bgi");
fillpoly(5,points);
getch();
closegraph();
return 0;
}
Download |
---|
0 comments:
Post a Comment
Click to see the code!
To insert emoticon you must added at least one space before the code.