我的代码如下,在运行过程中出现了问题,就是画面好闪,还有就是小圆不能很好的擦除,哪位懂的能帮帮我把代码改一下吗?谢谢了!
#include<graphics.h>
#include<stdio.h>
#include<dos.h>
main()
{
int gdriver=DETECT,gmode,x,y=180,i;
initgraph(&gdriver,&gmode,""); /*初始化图形系统*/
cleardevice();
rect();/*调用画图函数*/
for(y=180;y>120;y--)
{
setcolor(RED);
outtextxy(90,100,"test line");
circle(120,y,2);
delay(10000);
setcolor(WHITE);
rect();
setcolor(RED);
circle(120,y,2);
}
cleardevice();
setcolor(WHITE);
rect();
getch();
closegraph();
}
rect()
{
setbkcolor(GREEN);
setlinestyle(SOLID_LINE,3,3);
line(90,120,510,120);
line(120,120,120,180);
line(240,120,240,180);
line(360,120,360,180);
line(480,120,480,180);
setcolor(YELLOW);
setfillstyle(SOLID_FILL,LIGHTGRAY);
bar(90,180,150,240);
bar(210,180,270,240);
bar(330,180,390,240);
bar(450,180,510,240);
outtextxy(95,210,"site 1");
outtextxy(215,210,"site 2");
outtextxy(335,210,"site 3");
outtextxy(455,210,"site 4");
}