Professional Documents
Culture Documents
(SELF-FINANCE WING)
ERODE-638 316
NAME :
REGISTER NO. :
CLASS :
SRI VASAVI COLLEGE, ERODE
(SELF-FINANCE WING)
ERODE-638 316
REGISTER NO:
This is to certify that this record work is done by
of III-B.Sc (IT) at the Department of Information Technology in Sri Vasavi College
[Self-Finance Wing], Erode during the VI Semester of the academic year 2022 - 2023.
STATION : ERODE
DATE :
GRAPHICS
1. ROTATE AN IMAGE
2. WORD DROPPING
3. DDA ALGORITHM
4. MOVING A CAR
5. BOUNCING BALL
7. SUN FLOWER
8. PLANE ANIMATION
9. PLASTIC SURGERY
11. WEBPAGE
AIM:
ALGORITHM:
STEP 4: Draw an image using circle method, get the input value for angle.
STEP 6: Display the image based on the co-ordinate values and angle values.
1
CODING:
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<math.h>
void main()
int gd=DETECT,gm,ang;
double de,x1,x2,y1,y2;
initgraph(&gd,&gm,”C:\\TC\\BGI”);
circle(200,140,40);
circle(250,140,40);
scanf(“%d”,&ang);
cleardevice();
de=ang+(3.14/180);
x1=200+100*cos(de)+100*sin(de);
y1=200+(-100)*sin(de)+100*cos(de);
x2=200+150*cos(de)+100*sin(de);
y2=200+(-150)*sin(de)+100*cos(de);
circle(x2,y2,20);
circle(x1,y1,40);
getch();
closegraph();
2
OUTPUT:
3
EX.NO : 2
AIM:
To write a program to drop each word of a sentence one by one from the top.
ALGORITHM:
STEP 7: Press any key to start dropping each word one by one.
4
CODING:
#include<stdio.h>
#include<graphics.h>
#include<string.h>
#include<conio.h>
char t[200],str[10][20];
int x[10],y[10],j=0;
void drop(int k)
{
int i,p,s;
for(p=60;p<440;p++)
{
cleardevice();
outtextxy(200,10,”Text Animation”);
for(s=k+1;s<=j;s++)
for(i=k+1;i<=s;i++)
outtextxy(x[i],50,str[i]);
outtextxy(y[k],p,str[k]);
for(s=0;s<=k;s++)
for(i=0;i<s-1;i++)
outtextxy(x[i],440,str[i]);
}
}
main()
{
int gd=DETECT,gm=0;
int l,i=0,k=0,m=0,m1,in=1;
int p;
clrscr();
initgraph(&gd,&gm,”C:\\TC\\BGI”);
settextstyle(1,0,2);
printf(“\nEnter The Sentence:”);
gets(t);
l=strlen(t);
while(i<l)
5
{
if(t[i]!=’’)
{
str[j][k]=t[i];
k++;
i++;
}
else
{
j++;
i++;
k=0;
}
}
cleardevice();
x[0]=m,y[0]=50;
for(i=0;i<=j;i++)
{
m1=textwidth(str[i]);
outtextxy(m,50,str[i]);
m=m+m1+10;
x[in]=m;
y[in]=50;
in++;
}
settextstyle(6,0,1);
outtextxy(0,100,”Press Any Key To Start Dropping”);
getch();
settextstyle(1,0,2);
for(i=0;i<=j;i++)
drop(i);
getch();
closegraph();
return 0;
}
6
OUTPUT:
7
EX.NO : 3
AIM:
ALGORITHM:
8
CODING:
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<math.h>
void main()
{
int gd=DETECT,gm=DETECT,s,dx,dy,m,x1,x2,y1,y2;
float xi,yi,x,y;
clrscr();
printf(“\nEnter the Starting Point Values One By One:”);
scanf(“%d%d”,&x1,&y1);
printf(“\nEnter the Ending Point Values One By One:”);
scanf(“%d%d”,&x2,&y2);
initgraph(&gd,&gm,”C:\\TC\\BGI”);
cleardevice();
dx=x2-x1;
dy=y2-y1;
if(abs(dx)>abs(dy))
s=abs(dx);
else
s=abs(dy);
xi=dx/(float)s;
yi=dy/(float)s;
x=x1;
y=y1;
putpixel(x1,y1,4);
for(m=0;m<s;m++)
{
x+=xi;
y+=yi;
putpixel(x,y,4);
}
getch();
}
9
OUTPUT:
10
EX.NO : 4
AIM:
ALGORITHM:
STEP 4: In draw_car(), use circle and line function for drawing the shape of the car.
STEP 5: Use sound() for producing the audio effect along with the moving car.
11
CODING:
#include<conio.h>
#include<dos.h>
#include<graphics.h>
main()
{
int i,j=0,gd=DETECT,gm;
initgraph(&gd,&gm,”C:\\TC\\BGI”);
settextstyle(DEFAULT_FONT,HORIZ_DIR,2);
outtextxy(25,240,”Press Any Key To View the Moving Car!”);
sound(500);
getch();
setviewport(0,0,639,440,1);
for(i=0;i<=420;i=i+10,j++)
{
rectangle(50+i,275,150+i,400);
rectangle(150+i,350,200+i,400);
circle(75+i,410,10);
circle(175+i,410,10);
setcolor(j);
delay(100);
if(i==420)
break;
clearviewport();
}
nosound();
getch();
closegraph();
return 0;
}
12
OUTPUT:
13
EX.NO : 5
AIM:
ALGORITHM:
STEP 5: Use setcolor() for applying the color and use functions- setfillstyle() and floodfill().
14
CODING:
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<dos.h>
void main()
{
int gd=DETECT,gm=DETECT;
int x,y=0,j,t=400,c=1;
initgraph(&gd,&gm,”C:\\TC\\BGI”);
setcolor(BLUE);
setfillstyle(SOLID_FILL,BLUE);
for(x=40;x<602;x++)
{
cleardevice();
circle(x,y,30);
floodfill(x,y,BLUE);
delay(40);
if(y>=400)
{
c=0;
t-=20;
}
if(y<=(400-t))
c=1;
y=y+(c?15:-15);
}
getch();
}
15
OUTPUT:
16
EX.NO : 6
AIM:
To write a program to test whether the given pixel is inside or outside the polygon.
ALGORITHM:
STEP 5: Get the co-ordinate value for the number of points used.
STEP 8: Display whether the pixel co-ordinate value is inside the polygon or outside the polygon.
17
CODING:
#include<graphics.h>
#include<conio.h>
main()
int gd=DETECT,gm,points[]={320,150,420,300,250,300,320,150};
int b,x,y;
initgraph(&gd,&gm,”C:\\TC\\BGI”);
fillpoly(4,points);
scanf(“%d%d”,&x,&y);
b=getpixel(x,y);
if(b==0)
else
getch();
closegraph();
return 0;
18
OUTPUT:
19
MULTIMEDIA
EX.NO : 7
AIM:
ALGORITHM:
STEP 10: Using the Brush Tool, draw a stem to the flower.
AIM:
ALGORITHM:
STEP 3: Select the Custom Shape Tool in the Toolbar and select plane icon.
STEP 7: Create a duplicate layer and change the position of the plane.
AIM:
ALGORITHM:
STEP 6: After applying the changes, save the image in the desired format.
AIM:
ALGORITHM:
DATE : WEBPAGE
AIM:
ALGORITHM:
STEP 7: Select the slice tool and select the particular part in each image.
STEP 8: Save the image for web in HTML and image file format.
STEP 9: Select Edit Slice option and give the address of the image in that particular part.
AIM:
To convert a black and white image into color image using Photoshop.
ALGORITHM:
STEP 5: Click Image Adjustment Color Balance to change the color of the image.
STEP 7: Adjust the brightness and contrast for enhancing the image quality.