Welcome to Scribd. Sign in or start your free trial to enjoy unlimited e-books, audiobooks & documents.Find out more
Download
Standard view
Full view
of .
Look up keyword
Like this
95Activity
0 of .
Results for:
No results containing your search query
P. 1
Computer Graphics Practicals

Computer Graphics Practicals

Ratings: (0)|Views: 21,206|Likes:
Published by Salman Mehdi
These 12 practicals + a Game Project I have made in 7th Term when I was doing BS(IT) from QUEST Nawabshah. Also videos are available on the net , www.06it29.tk
These 12 practicals + a Game Project I have made in 7th Term when I was doing BS(IT) from QUEST Nawabshah. Also videos are available on the net , www.06it29.tk

More info:

Published by: Salman Mehdi on Jan 23, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

10/18/2014

pdf

text

original

 
Computer Graphics Practical
By Mukhtiar Ahmed Kori
Syed Salman Mehdi
-
06IT29
 
QUEST Nawabshah
 1
Practical – 01
Object:
 
Perform a LINE statement activity
.
Tool:
 
Turbo C++ compiler of Borland
 
Language:
 
C.
 
Line Statement
:
The line statement we use in C programming for graphics and it is a part of 
GRAPHICS.H
header file
.
Through line statement we can draw lines for creating shapes in our programs. Inthis practical we learn how to create lines and make shapes through line statement.It is necessary to create
Computer Graphics
through
C
programming
.
Syntax of Line statement
:
line(x1, y1, x2, y2);
 
The syntax shows four values
x1, y1, x2, y2
. The first two values are
x1, y1
are forinitial point or pixel address where you start the line and the second part is
x2, y2
 which is for last of ending point of the line
.
How to make shapes?You can create lines with this type of simple programs.
#include<graphics.h>#include<stdio.h>#include<conio.h>void main (void){clrscr ();int gd,gm;gd=DETECT;initgraph (&gd, &gm,"c:\\tc\\bgi"); // initializing graphicsline (10, 10, 600, 10); //simple line}/end of program.
Output:
Figure 1.1: How to draw Line in C Graphics mode.
 
Computer Graphics Practical
By Mukhtiar Ahmed Kori
Syed Salman Mehdi
-
06IT29
 
QUEST Nawabshah
 2
 
Create a triangle
line (20, 80, 60, 30); //triangleline (60, 30, 100, 80);line (20, 80, 100, 80); //complete triangle
Create a Triangle in a Square.
line (20, 90, 100, 90); //square with triangleline (20, 90, 20,150); //squareline (20,150,100,150);line (100, 150, 100, 90); //square completeline (60, 90, 20,150); //triangleline (60, 90,100,150); //complete triangle
Output:
Figure 1.2 How to draw a Triangle & Triangle in Square.
 Creating a Two triangle in a Cross on each other is
:
line (20,160,200,160); // squareline (20, 160, 20,300);line (20,300,200,300);line (200,160,200,300); //square completeline (110, 170, 45,290); //triangleline (110,170,175,290);line (45,290,175,290);line (108,290,185,200);line (185, 200, 35,200);line (35,200,108,290); // triangle complete.
 
Computer Graphics Practical
By Mukhtiar Ahmed Kori
Syed Salman Mehdi
-
06IT29
 
QUEST Nawabshah
 3
Output:
Figure 1.3: How to draw Cross Line Triangle which intersects each other.
Creating a Star with Line statement
:
line (110, 320, 45,440); //only starline (110,320,175,440);line (45,440,185,350);line (185, 350, 35,350);line (35,350,175,440); //star complete
Output:
Figure 1.4: How to draw a Star.
U
How to make a hut with line Statement
#include<graphics.h>#include<conio.h>#include<stdio.h>void main (void)

Activity (95)

You've already reviewed this. Edit your review.
Shamal Aryan added this note
9YC
Shamal Aryan liked this
1 hundred reads
1 thousand reads
Salman Mehdi added this note
you can download more things from file hosting , I have complete collection of notes of BS(IT) http://salmanmehdi.co.cc
Maharshi Mehta added this note
thank you so so so much u hv been so much helpfull to me....... :)
Salman Mehdi added this note
Thanks all of you for reading their. Your comment is price of sharing , it is my appreciation. you can contact with on 06it29quest@gmail.com
Hi added this note
ulol
Dipisa Jha added this note
it is halpful for me so thank you
Karthik Keyan liked this

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->