Translate

Thursday, April 30, 2020

House using line drowing primitive in graphics.

Aim:Write a program to demonstrate a house using line drowing primitive in graphics.

Source Code:


#include<graphics.h>
#include<iostream.h>
#include<conio.h>
void main()
{
int gd = DETECT,gm;
initgraph(&gd,&gm,"C:\\TURBOC3\\BGI");
line(100,100,50,200);
line(100,100,150,200);
line(50,200,150,200);
rectangle(50,200,150,400);
rectangle(150,400,500,200);
line(100,100,450,100);
line(450,100,500,200);
rectangle(275,400,375,250);
getch();
closegraph();
}


YOUTUBE VIDEO:


Output:

NOTE: 
1.In that above coding "C:\\TURBOC3\\BGI" this line will represent the path where your project was save.
2.The line syntax is "line(int x1,int y1, int x2,int y2);"
3.The rectangle is "rectangle(int left,int top,int right,int bottam):"





No comments:

Post a Comment

Bresenhanse Line Darwing Algorithm