#include"iostream.h"
#include"conio.h"
#include"graphics.h"
#include"dos.h"
#include"stdlib.h"
#include"math.h"
void main()
{
int gd=DETECT,gm,x=250,y=250,x1=300,y1=300,x2,y2,i=1;
initgraph(&gd,&gd,"c:\\tc\\bgi");
int ch;
x=getmaxx();
y=getmaxy();
do
{
setcolor(10);
outtextxy(10,20,"SCREEN SAVER PROGRAM");
setcolor(10);
outtextxy(10,30,"1.PIXEL PLOTTING");
setcolor(2);
outtextxy(10,40,"2.CIRCLE PLOTTER");
setcolor(3);
outtextxy(10,50,"3.RECTANGLE CLIPPER");
setcolor(4);
outtextxy(10,60,"4.LINE MOVER");
setcolor(5);
outtextxy(10,70,"5.ARC CURVER");
setcolor(6);
outtextxy(10,80,"6.ZIG ZAG CILIPPING");
setcolor(7);
outtextxy(10,90,"0.FOR EXIT");
setcolor(8);
outtextxy(10,110,"NOW ENTER UR CHOICE=>");
cin>>ch;
switch(ch)
{
case 1:
i=1;
cleardevice();
while(!kbhit())
{
getpixel(random(x),random(y));
putpixel(random(x),random(y),random(i));
setcolor(i);
delay(5);
i++;
}
cleardevice();
break;
case 2:
i=1;
cleardevice();
while(!kbhit())
{
circle(random(x),random(y),random(i));
setcolor(i);
delay(50);
i++;
}
cleardevice();
break;
cleardevice();
case 3:
i=1;
cleardevice();
while(!kbhit())
{
rectangle(random(x),random(y),random(x1),random(y1));
setcolor(i);
delay(50);
i++;
}
cleardevice();
break;
case 4:
i=1;
cleardevice();
while(!kbhit())
{
line(random(cos(x*2)),random(y),random(cos(x1*2)),random(y1));
setcolor(i);
delay(50);
i++;
}
cleardevice();
break;
case 5:
i=1;
cleardevice();
while(!kbhit())
{
arc(random(x),random(y),random(10),random(y1),5);
setcolor(i);
delay(50);
i++;
}
cleardevice();
case 0:exit(1);
case 6:
i=1;
cleardevice();
while(!kbhit())
{
lineto(random(x),random(y));
setcolor(i);
delay(200);
i++;
}
cleardevice();
break;
}
}while(ch!=0);
getch();
}
No comments:
Post a Comment