23 February, 2010

Computer Graphics : Bucket overflowing with water

Computer Graphics program to illustrate a bucket overflowing with water...

#include"conio.h"
#include"dos.h"
#include"graphics.h"

void main()
{
int gd=DETECT,gm=DETECT,i,j;
initgraph(&gd,&gm,”c:\tc\bgi”);
ellipse(300,200,0,360,50,25);
ellipse(300,300,0,360,50,25);
line(250,200,250,300);
line(350,200,350,300);
ellipse(300,100,180,360,5,2);
line(295,100,295,80);
line(305,100,305,86);
arc(300,80,90,180,5);
putpixel(306,85,15);
putpixel(307,84,15);
line(308,84,630,84);
line(300,75,303,75);
line(314,75,630,75);
putpixel(304,74,15);
putpixel(305,73,15);
line(306,72,306,65);
line(311,72,311,65);
putpixel(312,73,15);
putpixel(313,74,15);
pieslice(309,62,0,360,5);

line(0,300,600,300);
for(i=0;i<4;i++)
{ line(297+i,103,297+i,300);
}
for(i=1;i<100;i++)
{
//
setcolor(1);
ellipse(300,300-i,180,360,4,2);
delay(50);
setcolor(1);
fillellipse(300,300-i,49,25);
delay(50);
}
for(i=0;i<101;i++)
{
setcolor(9);
ellipse(300,198+i,0,360,53,25);
setcolor(15);
ellipse(300,200,0,360,50,25);
ellipse(300,300,0,360,50,25);
line(250,200,250,300);
line(350,200,350,300);
delay(50);

}
for(i=0;i<50;i++)
{
setcolor(9);
ellipse(300,301,180,360,50+i,25+i);
delay(50) ;
}
getch();
}

0 comments:

Post a Comment

speak out... itz your time !!!

 

Terminal Diary | techblog Copyright © 2009 Gadget Blog is Designed by jintu jacob Powered by Blogger