You are here

fillpoly function in c

Fillpoly function draws and fills a polygon. It require same arguments as drawpoly.

Declaration: void drawpoly( int num, int *polypoints );
For details of arguments see drawpoly.
fillpoly fills using current fill pattern and color which can be changed using setfillstyle.

C programming code

  1. #include <graphics.h>
  2. #include <conio.h>
  3.  
  4. main()
  5. {
  6.    int gd=DETECT,gm,points[]={320,150,440,340,230,340,320,150};
  7.  
  8.    initgraph(&gd, &gm, "C:\\TC\\BGI");
  9.  
  10.    fillpoly(4, points);
  11.  
  12.    getch();
  13.    closegraph();
  14.    return 0;
  15. }