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

Windows编程

开发平台:

Visual C++

  1. #include<graphics.h>
  2. #include<conio.h>
  3. void main(void)
  4. {
  5. int driver=DETECT,mode;
  6. int X0=200,Y0=250;
  7. int X=200,Y=60,A=100,B=50;
  8. int X1=200,Y1=400;
  9. int NUM;
  10. registerbgidriver(EGAVGA_driver);
  11. initgraph(&driver,&mode,"");
  12. setcolor(YELLOW);
  13. for(NUM=0;NUM<10;NUM++)
  14. {
  15.     ellipse(X,Y,0,360,A,B+NUM);
  16. }
  17. setcolor(11);
  18. outtextxy(400,100,"* * * RING OF LIGHT * * *");
  19. setcolor(13);
  20. outtextxy(300,160,"To see the ellipse,PRESS ANY KRY... ...");
  21. getch();
  22. setcolor(YELLOW);
  23. ellipse(X0,Y0,0,360,A,B);
  24. setcolor(11);
  25. outtextxy(400,250,"* * * NORMAL ELLIPSE * * *");
  26. setcolor(13);
  27. outtextxy(300,310,"To see the ellipse FILLED,PRESS ANY KRY... ...");
  28. getch();
  29. setcolor(YELLOW);
  30. setfillstyle(5,11);
  31. fillellipse(X1,Y1,A,B);
  32. setcolor(11);
  33. outtextxy(400,400,"* * * FILLED ELLIPSE * * *");
  34. setcolor(13);
  35. outtextxy(300,460,"PRESS ANY KEY to EXIT... ...");
  36. getch();
  37. closegraph();
  38. }