Show Mobile Navigation

Tuesday, September 18, 2012

A Simple Man in C Graphics

ashok royal - 21:34
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<dos.h>
void main()
{
int gd=DETECT,gm,i,j;
initgraph(&gd,&gm,"c:\\turboc3\\bgi");
setbkcolor(LIGHTGRAY);
for(i=0;i<500;i++)

{
if(i%11==0)
{

for(j=i;j<i+5;j++)
{
setcolor(BLUE);

//head
line(55+j,318,65+j,318);
ellipse(50+j,300,0,360,20,30);
setfillstyle(SOLID_FILL,LIGHTBLUE);
floodfill(50+j,300,BLUE);
ellipse(60+j,295,0,360,5,8);
setfillstyle(SOLID_FILL,WHITE);
floodfill(60+j,296,BLUE);
ellipse(60+j,295,60,120,7,10);
ellipse(61+j,298,0,360,3,4);
setfillstyle(SOLID_FILL,BLUE);
floodfill(61+j,298,BLUE);
//b0dy
rectangle(30+j,340,70+j,401);
setfillstyle(SOLID_FILL,WHITE);
floodfill(31+j,341,BLUE);
//solder
arc(50+j,340,0,58,20);
arc(50+j,340,122,180,20);
setfillstyle(SOLID_FILL,WHITE);
floodfill(50+j,339,BLUE);
//hand
rectangle(40+j,340,60+j,385);
setfillstyle(SOLID_FILL,WHITE);
floodfill(41+j,341,BLUE);
//pant
rectangle(38+j,401,62+j,451);
setfillstyle(SOLID_FILL,WHITE);
floodfill(39+j,402,BLUE);
//shoe
rectangle(38+j,451,68+j,461);
setfillstyle(SOLID_FILL,BLUE);
floodfill(39+j,452,BLUE);
//half in next post




delay(20);
cleardevice();
}}
if(i%17==0)
for(j=i;j<i+5;j++)
{

setcolor(BLUE);
//head
line(55+j,318,65+j,318);
ellipse(50+j,300,0,360,20,30);
setfillstyle(SOLID_FILL,LIGHTBLUE);
floodfill(50+j,300,BLUE);
ellipse(60+j,295,0,360,5,8);
setfillstyle(SOLID_FILL,WHITE);
floodfill(60+j,296,BLUE);
ellipse(60+j,295,60,120,7,10);
ellipse(61+j,298,0,360,3,4);
setfillstyle(SOLID_FILL,BLUE);
floodfill(61+j,298,BLUE);
//body
rectangle(30+j,340,70+j,401);
setfillstyle(SOLID_FILL,WHITE);
floodfill(61+j,298,BLUE);

//solder
arc(50+j,340,0,58,20);
arc(50+j,340,122,180,20);
setfillstyle(SOLID_FILL,WHITE);
floodfill(50+j,339,BLUE);
//left hand
line(30+j,350,3+j,385);
line(30+j,370,23+j,385);
line(3+j,385,23+j,385);

//right hand
line(40+j,340,63+j,385);
line(60+j,340,83+j,385);
line(63+j,385,83+j,385);

//right leg
line(38+j,401,72+j,451);
line(62+j,401,92+j,451);
line(72+j,451,92+j,451);

//left leg
line(38+j,401,10+j,451);
line(50+j,421,30+j,451);
line(10+j,451,30+j,451);
//shoe
rectangle(10+j,451,40+j,461);
setfillstyle(SOLID_FILL,BLUE);
floodfill(11+j,452,BLUE);
rectangle(72+j,451,102+j,461);
setfillstyle(SOLID_FILL,BLUE);
floodfill(73+j,452,BLUE);
delay(20);
cleardevice();

}
}
getch();
}
output screen


0 comments:

Post a Comment

Comments : Read Them Or Add One to promote us