Hello Friends,
I was just writing a program in C. In this program i was trying to give the rotation affect like the for pie-slices are moving.
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<dos.h>
int main(void)
{
int gd=DETECT,gm,i=1,count=1;
initgraph(&gd,&gm,"d:\\tc\\bgi");
do{
i=count%2==0?2:1;
setfillstyle(1,i);
delay(500);
pieslice(319,239,20,60,100); //A1
i=count%2==0?1:2;
setfillstyle(1,i);
delay(500);
pieslice(319,239,120,160,100); //B1
i=count%2==0?2:1;
setfillstyle(1,i);
delay(500);
pieslice(319,239,200,240,100); //A2
i=count%2==0?1:2;
setfillstyle(1,i);
delay(500);
pieslice(319,239,300,340,100); //B2
count++;
}while(count<20);
getch();
cleardevice();
closegraph();
return 0;
}
I want that the effect must be like that its rotating (by shifting one backgraound to other).. and consecutive pie-slices should have differnt colors. but unfortunately it doesnt happen. please help
I am performing this program on Turbo C++, on windows XP SP3
thanks
Amandeep Singh