You are on page 1of 36

SRI VASAVI COLLEGE, ERODE.

(SELF-FINANCE WING)
ERODE-638 316

DEPARTMENT OF INFORMATION TECHNOLOGY


CORE 10 : GRAPHICS & MULTIMEDIA PROGRAMMING

RECORD NOTE BOOK

NAME :

REGISTER NO. :

CLASS :
SRI VASAVI COLLEGE, ERODE
(SELF-FINANCE WING)
ERODE-638 316

DEPARTMENT OF INFORMATION TECHNOLOGY


CORE 10 : GRAPHICS & MULTIMEDIA PROGRAMMING

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.

STAFF IN CHARGE HEAD OF THE DEPARTMENT

Submitted for the Practical Examination held on at the Department


of Information Technology in Sri Vasavi College [Self-Finance Wing], Erode.

STATION : ERODE
DATE :

INTERNAL EXAMINER EXTERNAL EXAMINER


INDEX

GRAPHICS

S.NO DATE TITLE PAGE NO.

1. ROTATE AN IMAGE

2. WORD DROPPING

3. DDA ALGORITHM

4. MOVING A CAR

5. BOUNCING BALL

6. PIXEL POSITION ON POLYGON

7. SUN FLOWER

8. PLANE ANIMATION

9. PLASTIC SURGERY

10. SEE THROUGH TEXT

11. WEBPAGE

CONVERSION OF BLACK & WHITE


12.
IMAGE TO COLOR IMAGE
GRAPHICS
EX.NO : 1

DATE : ROTATE AN IMAGE

AIM:

To create a program to rotate an image.

ALGORITHM:

STEP 1: Start the process.

STEP 2: Declare the variables that are necessary.

STEP 3: Assign the path C:\\TC\\BGI using initgraph method.

STEP 4: Draw an image using circle method, get the input value for angle.

STEP 5: Calculate x1,y1,x2,y2 co-ordinates using the formula.

STEP 6: Display the image based on the co-ordinate values and angle values.

STEP 7: Display the output.

STEP 8: Stop the process.

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);

printf(“\nEnter the Angle:”);

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

DATE : WORD DROPPING

AIM:

To write a program to drop each word of a sentence one by one from the top.

ALGORITHM:

STEP 1: Start the process.

STEP 2: Declare the variables.

STEP 3: Assign the path C:\\TC\\BGI using the initgraph method.

STEP 4: Get any text or sentence as input.

STEP 5: Calculate the length of the sentence using strlen().

STEP 6: In drop(), use outtextxy() to drop the word.

STEP 7: Press any key to start dropping each word one by one.

STEP 8: Produce the output.

STEP 9: Stop the process.

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

DATE : DDA ALGORITHM

AIM:

To create a program to draw a line using DDA Algorithm.

ALGORITHM:

STEP 1: Start the process.

STEP 2: Declare the required variables.

STEP 3: Assign the path C:\\TC\\BGI using initgraph method.

STEP 4: Get input values for x1 and y1 as starting point values.

STEP 5: Get input values for x2 and y2 as ending point values.

STEP 6: Calculate dx and dy values.

STEP 7: Use DDA algorithm for drawing a line.

STEP 8: Display the result.

STEP 9: Stop the process.

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

DATE : MOVING A CAR

AIM:

To write a program to move a car with sound effect.

ALGORITHM:

STEP 1: Start the process.

STEP 2: Declare the variables.

STEP 3: Assign the path C:\\TC\\BGI using initgraph method.

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.

STEP 6: Display the result.

STEP 7: Stop the process.

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

DATE : BOUNCING BALL

AIM:

To write a program to bounce a ball and move it with sound effect.

ALGORITHM:

STEP 1: Start the process.

STEP 2: Declare the variables.

STEP 3: Assign the path C:\\TC\\BGI using initgraph method.

STEP 4: Use circle() for drawing a ball.

STEP 5: Use setcolor() for applying the color and use functions- setfillstyle() and floodfill().

STEP 6: Display the result.

STEP 7: Stop the process.

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

DATE : PIXEL POSITION ON POLYGON

AIM:

To write a program to test whether the given pixel is inside or outside the polygon.

ALGORITHM:

STEP 1: Start the process.

STEP 2: Declare the variables.

STEP 3: Assign the path C:\\TC\\BGI using initgraph method.

STEP 4: Get the number of points as input value.

STEP 5: Get the co-ordinate value for the number of points used.

STEP 6: Display the polygon using fillpoly().

STEP 7: Get input value for pixel co-ordinate value.

STEP 8: Display whether the pixel co-ordinate value is inside the polygon or outside the polygon.

STEP 9: Display the result.

STEP 10: Stop the process.

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);

printf(“\nEnter the Pixel Co-Ordinate to Find Boundary:”);

scanf(“%d%d”,&x,&y);

b=getpixel(x,y);

if(b==0)

printf(“\nThe Pixel Co-Ordinate is Outside the Boundary!”);

else

printf(“\nThe Pixel Co-Ordinate is Inside the Boundary!”);

getch();

closegraph();

return 0;

18
OUTPUT:

19
MULTIMEDIA
EX.NO : 7

DATE : SUN FLOWER

AIM:

To create a flower image using Photoshop.

ALGORITHM:

STEP 1: Start the process.

STEP 2: Open a new document.

STEP 3: Click Custom Shape Tool.

STEP 4: Select flower icon.

STEP 5: Click Style, then go to float rounded normal icon.

STEP 6: Each time, select the Menu Bar  Layer.

STEP 7: Click Custom Shape Tool again.

STEP 8: Select grass icon.

STEP 9: Draw an eclipse at the center of the flower.

STEP 10: Using the Brush Tool, draw a stem to the flower.

STEP 11: Save the image in the desired file format.

STEP 12: Stop the process.


OUTPUT:
EX.NO : 8

DATE : PLANE ANIMATION

AIM:

To create a plane animation using Photoshop.

ALGORITHM:

STEP 1: Start the process.

STEP 2: Open a cloud image in RGB format.

STEP 3: Select the Custom Shape Tool in the Toolbar and select plane icon.

STEP 4: Select the color and draw the shape.

STEP 5: Then click Jump to Adobe Image Ready icon.

STEP 6: Select Window  Animation

STEP 7: Create a duplicate layer and change the position of the plane.

STEP 8: Set the layer type.

STEP 9: Save the file and play the animation.

STEP 10: Stop the process.


OUTPUT:
EX.NO : 9

DATE : PLASTIC SURGERY

AIM:

To perform the plastic surgery using Photoshop.

ALGORITHM:

STEP 1: Start the process.

STEP 2: Open the image.

STEP 3: Select the filter option in menu bar.

STEP 4: Filter  Liquify  Select Pucker Tool or Bloat Tool.

STEP 5: Adjust the particular area and it will change slightly.

STEP 6: After applying the changes, save the image in the desired format.

STEP 7: Stop the process.


OUTPUT:

BEFORE NOSE SURGERY

AFTER NOSE SURGERY


EX.NO : 10

DATE : SEE THROUGH TEXT

AIM:

To create a see through text using Photoshop.

ALGORITHM:

STEP 1: Start the process.

STEP 2: Open an existing image.

STEP 3: Click Text Tool in Toolbar.

STEP 4: Select horizontal type mask text tool.

STEP 5: Type some text on the image.

STEP 6: Open a new document.

STEP 7: Select the move tool.

STEP 8: Move the text tool to the new document.

STEP 9: Save the image.

STEP 10: Stop the process.


OUTPUT:
EX.NO : 11

DATE : WEBPAGE

AIM:

To create a webpage using Photoshop.

ALGORITHM:

STEP 1: Start the process.

STEP 2: Open an existing image.

STEP 3: Click Text Tool in Toolbox.

STEP 4: Select the horizontal text and type some text.

STEP 5: Give style to the text through the blending option.

STEP 6: Repeat the STEP 2-STEP 5 until the process is finished.

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.

STEP 10: Repeat the steps and display the output.

STEP 11: Stop the process.


OUTPUT:
EX.NO : 12 CONVERSION OF BLACK & WHITE IMAGE

DATE : TO COLOR IMAGE

AIM:

To convert a black and white image into color image using Photoshop.

ALGORITHM:

STEP 1: Start the process.

STEP 2: Open an existing black and white image.

STEP 3: Select the Magnetic Lasso Tool in Toolbox.

STEP 4: Select the particular part to change the color.

STEP 5: Click Image  Adjustment  Color Balance to change the color of the image.

STEP 6: Alternatively, Press Ctrl + B to change the color of the image.

STEP 7: Adjust the brightness and contrast for enhancing the image quality.

STEP 8: After applying colors for a range, save the image.

STEP 9: Stop the process.


OUTPUT:

BLACK AND WHITE IMAGE

CONVERTED COLOR IMAGE

You might also like