Draw a shirt



Here we are going to know how to create a shirt using C-Graphics functions.You have to use some basic functions of c-graphics in order to create shirt in c-graphics programming.Here is a code for this:

#include<stdio.h>

#include<conio.h>

#include<graphics.h>

void main()

{

int gd=DETECT,gm;

initgraph(&gd,&gm,"");

setbkcolor(WHITE);

setcolor(DARKGRAY);

line(250,170,250,300);

line(370,170,370,300);

line(250,300,370,300);

line(310,170,310,300);

setfillstyle(SOLID_FILL,DARKGRAY);

circle(312,180,2);

floodfill(312,180,DARKGRAY);

circle(312,200,2);

floodfill(312,200,DARKGRAY);

circle(312,220,2);

floodfill(312,220,DARKGRAY);

circle(312,240,2);

floodfill(312,240,DARKGRAY);

circle(312,260,2);

floodfill(312,260,DARKGRAY);

circle(312,280,2);

floodfill(312,280,DARKGRAY);

line(345,190,345,210);

line(365,190,365,210);

line(345,210,365,210);

line(345,190,365,190);

line(250,195,230,215);

line(230,215,215,180);

line(215,180,240,150);

line(240,150,280,140);

line(370,195,390,215);

line(390,215,405,180);

line(405,180,380,150);

line(380,150,345,140);

line(295,130,330,130);

line(295,130,275,142);

line(330,130,350,142);

line(275,142,315,152);

line(350,142,310,152);

line(313,130,313,152);

getch();

closegraph();

}



This above code is used to draw a shirt on your output screen.We have used the simple functions like line and circle to draw the shirt and setfillstyle and floodfill functions are used here for fill the color in buttons.You can study these functions in detail from our tutorial "Graphics in C".Here is the output of the above program:



Output

c_graphics