Professional Documents
Culture Documents
B.Sc(INFORMATION TECHNOLOGY)
2015 – 2016
Record Note Book
NAME :
Reg.No :
Register No:
CONTENTS
S.NO DATE PARTICULARS PAGE. SIGN
NO
PHOTOSHOP
1 SUN FLOWER
4 SEE-THROUGH TEXT
5 WEB PAGE
COMPUTER GRAPHICS
1 ROTATE AN IMAGE
5 BOUNCE A BALL
EX.NO: 01
SUN FLOWER
DATE:
AIM:
ALGORITHM:
OUTPUT:
RESULT:
EX.NO:02
ALGORITHM:
OUTPUT:
RESULT:
EX.NO:03
PLASTIC SURGERY FOR NOSE
DATE:
AIM:
ALGORITHM:
OUTPUT:
RESULT:
EX.NO:04
SEE-THROUGH TEXT
DATE:
AIM:
ALGORITHM:
OUTPUT:
RESULT:
EX.NO:05
WEB PAGE
DATE:
AIM:
ALGORITHM:
OUTPUT:
RESULT:
EX.NO:06
BLACK & WHITE PHOTO TO COLOR PHOTO
DATE:
AIM:
ALGORITHM:
OUTPUT:
RESULT:
COMPUTER GRAPHICS
EX.NO:01
ROTATE AN IMAGE
DATE:
AIM:
ALGORITHM:
PROGRAM 1:
#include<iostream.h>
#include<conio.h>
#include<graphics.h>
#include<math.h>
void main()
{
int gd=DETECT,gm;
int x1=50,y1=150,x2=70,y2=170;
int x3=120,y3=140;
int rot;
int rx1,rx2,rx3,ry1,ry2,ry3;
initgraph(&gd,&gm,"");
cout<<"\n \t ROTATE AN IMAGE\n";
outtextxy(20,130,"Before Rotation");
line(x1,y1,x2,y2);
line(x2,y2,x3,y3);
line(x3,y3,x1,y1);
cout<<"\n Enter the Angle of Rotation:";
cin>>rot;
rx1=(x1*cos(rot))+(y1*sin(rot))+50;
rx2=(x2*cos(rot))+(y2*sin(rot))+50;
rx3=(x3*sin(rot))+(y3*sin(rot))+50;
ry1=(-x2*sin(rot))+(y1*cos(rot))+50;
ry2=(x2*sin(rot))+(y2*cos(rot))+50;
ry3=(x3*sin(rot))+(y3*cos(rot))+50;
outtextxy(200,130,"After Rotation");
line(rx1,ry1,rx2,ry2);
line(rx2,ry2,rx3,ry3);
line(rx3,ry3,rx1,ry1);
getch();
closegraph();
}
OUTPUT:
ROTATE AN IMAGE
Before Rotation
After Rotation
RESULT:
EX.NO:02
DROP EACH WORD OF SENTENCE ONE BY ONE
DATE:
AIM:
ALGORITHM:
PROGRAM 2:
#include<iostream.h>
#include<conio.h>
#include<graphics.h>
#include<dos.h>
void main()
{
int gd=DETECT,gm,i;
initgraph(&gd,&gm," ");
setbkcolor(5);
for(i=0;i<350;i++)
{
settextstyle(3,0,1);
outtextxy(200,40,"WELCOME");
setcolor(15);
outtextxy(100,40+i,"KASC");
delay(5);
cleardevice();
}
for(i=0;i<350;i++)
{
outtextxy(100,400,"KASC");
setcolor(15);
outtextxy(200,40+i,"WELCOME");
delay(5);
cleardevice();
}
outtextxy(100,400,"KASC");
outtextxy(200,400,"SATHY");
getch();
closegraph();
}
OUTPUT:
WELCOME
KASC
RESULT:
EX.NO:03
DROP A LINE USING DDA ALGORITHM
DATE:
AIM:
ALGORITHM:
PROGRAM 3:
#include<iostream.h>
#include<conio.h>
#include<math.h>
#include<graphics.h>
#include<dos.h>
void main()
{
int xa,xb,ya,yb,dx,dy,steps,i,j;
int xinc,yinc,x,y,k;
int gd=DETECT,gm;
initgraph(&gd,&gm,"");
setbkcolor(0);
cleardevice();
cout<<"\n\t DDA LINE DRAWING\n";
cout<<"\n Enter the value for x and y:\n";
cin>>xa>>ya;
cout<<"\n Enter the value for x and y:\n";
cin>>xb>>yb;
cleardevice();
dx=xb-xa;
dy=yb-ya;
if(abs(dx)>abs(dy))
steps=abs(dx);
else
steps=abs(dy);
xinc=dx/steps;
yinc=dy/steps;
x=xa;
y=ya;
putpixel(x,y,12);
for(k=1;k<=steps;k++)
{
settextstyle(3,0,0);
delay(100);
putpixel(x,y,3);
x=x+xinc;
y=y+yinc;
}
getch();
closegraph();
}
OUTPUT:
RESULT:
EX.NO:04
MOVING CAR WITH SOUND EFFECT
DATE:
AIM:
ALGORITHM:
PROGRAM 4:
#include<iostream.h>
#include<conio.h>
#include<graphics.h>
#include<dos.h>
void main()
{
int gd=DETECT,gm,i;
initgraph(&gd,&gm," ");
while(!kbhit())
{
for(i=5;i<=370;i=i+5)
{
settextstyle(TRIPLEX_FONT,HORIZ_DIR,5);
outtextxy(150,80,"MOVING A CAR");
line(10+i,450,60+i,450);
circle(80+i,450,20);
line(100+i,450,190+i,450);
circle(210+i,450,20);
line(230+i,450,270+i,450);
line(10+i,450,20+i,380);
line(20+i,380,200+i,380);
line(40+i,380,60+i,320);
line(60+i,320,160+i,320);
line(160+i,320,200+i,380);
line(200+i,380,260+i,410);
line(260+i,410,270+i,450);
sound(200);
delay(300);
cleardevice();
}
}
closegraph();
}
OUTPUT:
MOVING A CAR
RESULT:
EX.NO:05
BOUNCE A BALL
DATE:
AIM:
ALGORITHM:
PROGRAM 5:
#include<iostream.h>
#include<conio.h>
#include<dos.h>
#include<graphics.h>
#include<stdlib.h>
#include<math.h>
void main()
{
int gd=DETECT,gm,k;
initgraph(&gd,&gm," ");
float x=1,y=0.00000,j=0.5,count=0.1;
float r=15,i;
cout<<"\t\t\t BOUNCE A BALL\n";
setcolor(14);
line(0,215,650,215);
sleep(1);
for(k=0;k<=7;k++)
{
for(i=90;i<=270;i+=10)
{
y=cos(((i*22/7)/180))/j;
if(y>0)
y=-y;
x+=5;
setcolor(14);
setfillstyle(1,14);
circle(x,y*100+200,r);
floodfill(x,y*100+200,14);
delay(100);
setcolor(0);
setfillstyle(1,0);
circle(x,y*100+200,r);
floodfill(x,y*100+200,0);
}
j+=count;
count+=1;
}
getch();
}
OUTPUT:
BOUNCE A BALL
RESULT:
EX.NO:06
GIVEN PIXEL INSIDE or OUTSIDE or ON A POLYGON
DATE:
AIM:
ALGORITHM:
PROGRAM 6:
#include<iostream.h>
#include<conio.h>
#include<graphics.h>
int polyside=5,c;
int polyx[6]={540,590,570,510,490,540};
int polyy[6]={220,270,320,320,270,220};
int x,y;
int pointinpoly(void);
void drawpolygon(void);
void main()
{
int gd=DETECT,gm;
initgraph(&gd,&gm,"");
drawpolygon();
outtextxy(200,100,"Pixel Inside or Outside");
cout<<"\t Enter the value of x and y :";
cin>>x>>y;
putpixel(x,y,7);
c=pointinpoly();
if(c==0)
cout<<"\n Outside";
else
cout<<"\n Inside";
getch();
}
int pointinpoly()
{
int i,j=polyside+1;
int oddnotes=0;
for(i=0;i<polyside;i++)
{
if((polyy[i]<y&&polyy[j]>=y)||(polyy[j]<y&&polyy[i]>=y))
{
if((polyx[i]+(y-polyy[i]/polyy[j]-polyy[i]))*(polyx[j]-polyx[i]<x))
{
oddnotes=1;
}
}
j=1;
}
return oddnotes;
}
void drawpolygon()
{
int i;
for(i=0;i<polyside;i++)
{
if(i==(polyside-1))
line(polyx[i],polyy[i],polyx[0],polyy[0]);
else
line(polyx[i],polyy[i],polyx[i+1],polyy[i+1]);
}
}
OUTPUT:
INSIDE
OUTSIDE
ON THE POLYGON
RESULT: