//Draw and fill a polygon
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
void main()
{
int gd=DETECT,gm;
int pts1[]={100,100,300,100,300,200,100,100};
int pts2[]={100,120,300,220,100,220,100,120};
initgraph(&gd,&gm,"C:\\TurboC3\\BGI");
drawpoly(4,pts1);
setfillstyle(2,3);
fillpoly(4,pts2);
getch();
closegraph();
}
No comments:
Post a Comment
Note: only a member of this blog may post a comment.