Draw Red Fort using C graphic
In this program, we have drawn a red fort using this graphic. On this topic, we have uploaded a video on YouTube, you can go and see our channel code studio there.
#include<iostream.h>
#include<conio.h>
#include<dos.h>
#include<stdlib.h>
#include<graphics.h>
void main()
{
int gd=DETECT,gm;
initgraph(&gd,&gm,"c:\\tc\\bgi");
line(30,450,600,450);
line(0,440,30,450);
line(650,436,600,450);
line(30,430,600,430);
line(0,420,30,430);
line(650,416,600,430);
line(30,410,600,410);
line(0,400,30,410);
line(650,400,600,410);
line(30,410,30,450);
line(600,410,600,450);
line(593,410,593,450);
line(37,410,37,450);
rectangle(40,215,590,370);
rectangle(200,215,410,370);
line(200,221,410,221);
line(200,227,410,227);
rectangle(210,250,400,260);
rectangle(213,260,397,370);
rectangle(235,270,290,367);
rectangle(310,270,370,367);
line(40,260,200,260);
line(40,265,200,265);
line(92,265,92,370);
line(148,265,148,370);
line(46,297,46,370);
line(46,297,66,266);
line(87,297,87,370);
line(87,297,64,266);
line(98,297,98,370);
line(98,297,118,266);
line(142,297,142,370);
line(142,297,118,266);
line(154,297,154,370);
line(154,297,174,266);
line(194,297,194,370);
line(194,297,174,266);
line(40,224,80,220);
line(80,220,156,220);
line(156,220,199,224);
line(40,228,80,224);
line(80,224,156,224);
line(156,224,199,228);
ellipse(60,218,10,170,9,20);
ellipse(100,218,10,170,9,20);
ellipse(140,218,10,170,9,20);
ellipse(178,218,10,170,9,20);
line(40,195,40,220);
line(80,195,80,215);
line(120,195,120,215);
line(160,195,160,215);
line(200,195,200,215);
line(40,195,59,170);
line(80,195,59,170);
line(80,195,97,170);
line(120,195,97,170);
line(120,195,137,170);
line(160,195,137,170);
line(160,195,177,170);
line(200,195,177,170);
rectangle(90,137,166,168);
line(90,168,90,180);
line(166,168,166,186);
ellipse(106,173,20,143,20,32);
ellipse(106,173,10,170,14,29);
ellipse(146,173,10,160,20,32);
ellipse(146,173,10,170,12,29);
line(90,137,80,133);
line(80,133,90,127);
line(166,137,177,133);
line(177,133,166,127);
line(90,127,166,127);
ellipse(128,126,0,180,33,33);
ellipse(128,90,0,360,7,3);
line(128,80,128,87);
//right
line(410,260,590,260);
line(410,265,590,265);
line(465,265,465,370);
line(528,265,528,370);
line(415,297,415,370);
line(415,297,433,266);
line(459,297,459,370);
line(459,297,436,266);
line(470,297,470,370);
line(470,297,494,266);
line(523,297,523,370);
line(523,297,494,266);
line(533,297,533,370);
line(533,297,556,266);
line(585,297,585,370);
line(585,297,556,266);
line(410,224,460,220);
line(460,220,530,220);
line(530,220,590,224);
line(410,228,460,224);
line(460,224,530,224);
line(530,224,590,228);
//
ellipse(430,218,10,170,9,20);
ellipse(476,218,10,170,9,20);
ellipse(519,218,10,170,9,20);
ellipse(565,218,10,170,9,20);
line(410,195,410,220);
line(454,195,454,215);
line(498,195,498,215);
line(540,195,540,215);
line(590,195,590,215);
line(410,195,429,170);
line(454,195,429,170);
line(454,195,476,170);
line(498,195,476,170);
line(498,195,520,170);
line(540,195,520,170);
line(540,195,565,170);
line(590,195,565,170);
rectangle(465,137,545,168);
line(545,168,545,189);
line(465,168,465,182);
ellipse(481,173,20,143,20,32);
ellipse(481,173,10,170,14,29);
ellipse(521,173,10,160,22,32);
ellipse(520,173,10,170,14,29);
line(464,137,456,133);
line(456,133,464,127);
line(544,137,554,133);
line(554,133,544,127);
line(465,127,544,127);
ellipse(504,126,0,180,33,33);
ellipse(504,90,0,360,7,3);
line(504,80,504,87);
//center-upper
line(205,110,205,214);
line(215,110,215,214);
line(205,110,215,110);
line(205,120,215,120);
line(205,122,215,122);
line(205,124,215,124);
line(205,199,215,199);
ellipse(210,99,180,360,15,12);
line(196,99,203,99);
line(224,99,216,99);
ellipse(210,99,0,180,6,8);
line(200,80,200,99);
line(206,80,206,92);
line(212,80,212,92);
line(219,80,219,99);
line(199,80,220,80);
line(199,64,199,79);
line(220,64,220,79);
ellipse(210,64,0,180,10,8);
line(210,48,210,57);
line(405,110,405,214);
line(396,110,396,214);
line(405,110,396,110);
line(396,120,405,120);
line(396,122,405,122);
line(396,124,405,124);
line(396,199,405,199);
ellipse(400,99,180,360,15,12);
line(385,99,395,99);
line(406,99,416,99);
ellipse(400,99,0,180,6,8);
line(390,80,390,99);
line(396,80,396,92);
line(402,80,402,92);
line(409,80,409,99);
line(389,80,410,80);
line(389,64,389,79);
line(410,64,410,79);
ellipse(399,64,0,180,10,8);
line(400,48,400,57);
ellipse(230,218,10,170,9,20);
ellipse(266,218,10,170,9,20);
ellipse(303,218,10,170,9,20);
ellipse(343,218,10,170,9,20);
ellipse(380,218,10,170,9,20);
line(247,195,247,215);
line(285,195,285,215);
line(323,195,323,215);
line(360,195,360,215);
line(217,195,227,170);
line(247,195,227,170);
line(247,195,266,170);
line(285,195,266,170);
line(285,195,305,170);
line(323,195,305,170);
line(323,195,340,170);
line(360,195,340,170);
line(360,195,376,170);
line(395,195,376,170);
line(216,170,396,170);
ellipse(224,173,10,150,10,18);
ellipse(244,173,10,170,10,18);
ellipse(264,173,10,170,10,18);
ellipse(284,173,10,150,10,18);
ellipse(324,173,10,170,10,18);
ellipse(364,173,10,170,10,18);
ellipse(304,173,10,170,10,18);
ellipse(343,173,10,170,10,18);
ellipse(384,173,10,170,10,18);
line(216,150,396,150);
ellipse(240,142,10,170,7,11);
line(234,142,238,149);
line(246,140,242,149);
line(240,127,240,131);
ellipse(260,142,10,170,7,11);
line(267,140,260,150);
line(252,140,258,150);
line(260,127,260,131);
ellipse(280,142,10,170,7,11);
line(287,140,280,150);
line(272,140,278,150);
line(280,127,280,131);
ellipse(300,142,10,170,7,11);
line(307,140,300,150);
line(292,140,298,150);
line(300,127,300,131);
ellipse(320,142,10,170,7,11);
line(327,140,320,150);
line(312,140,318,150);
line(320,127,320,131);
ellipse(340,142,10,170,7,11);
line(347,140,340,150);
line(332,140,338,150);
line(340,127,340,131);
ellipse(360,142,10,170,7,11);
line(367,140,360,150);
line(352,140,358,150);
line(360,127,360,131);
rectangle(289,30,294,150);
rectangle(294,35,340,45);
rectangle(294,45,340,55);
rectangle(294,55,340,65);
circle(316,50,5);
line(312,46,316,50);
line(316,46,316,50);
line(319,46,316,50);
line(319,46,316,55);
line(312,46,316,54);
outtextxy(450,10,"Draw By Shubham Pandey");
getch();
closegraph();
}
Comments
Post a Comment