POLYGON.CPP
上传用户:wszmarenbt
上传日期:2013-04-26
资源大小:2552k
文件大小:1k
源码类别:

Windows编程

开发平台:

Visual C++

  1. /*----------------------------PICTURE-----------------------------*/
  2. /* NAME: GEOMETRIC PERSON    */
  3. /*    TOOL: POLYGON  */
  4. /*----------------------------PICTURE-----------------------------*/
  5. #include<graphics.h>
  6. #include<conio.h>
  7. #include<dos.h>
  8. void main()
  9. {
  10. int driver=DETECT,mode;
  11. int DATAARRAY[]={250,200,150,300,450,300,350,200,250,200};
  12. int NUM;
  13. registerbgidriver(EGAVGA_driver);
  14. initgraph(&driver,&mode,"");
  15. for(NUM=0;NUM<15;NUM++)
  16. {
  17. setcolor(NUM);                              /*SET THE COLOR OF LINES*/
  18. setlinestyle(SOLID_LINE,0,THICK_WIDTH);     /*SET THE LINE STYLE*/
  19. circle(300,150,50);          /*DRAW THE HEAD*/
  20. circle(285,140,7);           /*DRAW THE LEFT EYE*/
  21. circle(315,140,7);           /*DRAW THE RIGHT EYE*/
  22. arc(300,150,225,315,25);     /*DRAW THE MOUTH*/
  23. drawpoly(5,DATAARRAY);       /*DRAW THE BODY*/
  24. delay(150);
  25. }
  26. getch(); /*PRESS ANY KEY TO RETURN */
  27. closegraph();
  28. }