A
PROJECT REPORT
ON
“2D SHAPE COLORING”
FOR THE DIPLOMA IN COMPUTER ENGINEERING
SUBMITTED BY
DANDGE KUNAL DIPAK
DHABADKAR ADESH SHIVAJI
GUNJAL SACHIN RAMESHWAR
UNDER THE GUIDANCE OF
Mrs. R.S.Pophale
DEPARTMENT OF COMPUTER ENGINEERING
CSMSS COLLEGE OF POLYTECHNIC,
CHH. SAMBHAJINAGAR , MAHARASHTRA,INDIA
AND
MAHARASHTRA STATE BOARD OF
TECHNICAL EDUCATION, MUMBAI
ACADEMIC YEAR 2023-24
CHHATRAPATI SHAHU MAHARAJ SHIKSHAN
SANSTHA’S
COLLEGE OF POLYTECHNIC
KANCHANWADI,PAITHANROAD,CHH.SAMBHAJINAGAR
A
MICRO-PROJECT REPORT ON
“2D SHAPE COLOURING”
FOR THE DIPLOMA IN COMPUTER ENGINEERING
SUBMITTED BY
DANDGE KUNAL DIPAK(2211520043)
DHABADKAR ADESH SHIVAJI(2211520046)
GUNJAL SACHIN RAMESHWAR(2211520057)
COMPUTER ENGINEERING SECOND YEAR
SUBMITTED TO
COMPUTER ENGINEERING DEPARTMENT
YEAR 2023-2024
CERTIFICATE OF COMPLETION
This is to certify that Following Students of third semester of Diploma in
Computer Engineering of Institute CSMSS College of Polytechnic (code:1152)
have completed the Micro Project satisfactorily in subject CGR (22318) for the
academic year 2023-2024 as prescribed in the curriculum.
Place: Chhatrapati Sambhajinagar DATE:- 07/ 11 /2023
SR.NO ENROLLMENT NAME OF STUDENT
NO.
1 2211520043 DANDGE KUNAL DIPAK
2 2211520046 DHABADKAR ADESH SHIVAJI
3 2211520057 GUNJAL SACHIN RAMESHWAR
Mrs.R.S.Pophale Mrs.R.S.Pophale Dr.Ganesh B.Dongre
(Course Teacher) (H.O.D) (Principal)
ACKNOWLEDGEMENT
We would like to express our thanks to the people who have helped us most
throughout our project. We would like to express our sincere thanks to the principal
of CSMSS College of Polytechnic Dr. Ganesh B. Dongre for being always with us
as a motivator. We are thankful to the H.O.D. of Computer Engineering Department
Mrs.R.S.Pophale for her kind support. We are grateful to our Project Guide Mrs.
R.S.Pophale for nonstop support and continuous motivation for the project. Her help
made us possible to complete our project with all accurate information. A special
thanks of our goes to our friends who helped us in completing the project, where they
all exchanged their own interesting ideas. We wish to thanks our parentsfor their
personal support or attention who inspired us to go our own way. Finally, we would
like to thank God who made all things possible for us till the end.
SR.NO ENROLLMENT NAME OF STUDENT
NO.
1 2211520043 DANDGE KUNAL DIPAK
2 2211520046 DHABADKAR ADESH SHIVAJI
3 2211520057 GUNJAL SACHIN RAMESHWAR
Mrs. R.S.Pophale
(Project Guide)
INDEX
SR.NO TITLE PAGEG.NO
1 MICRO-PROJECT PROPOSAL 01
2 AIM/BENEFIT OF THE PROJECT 01
3 COURSE OUTCOME 01
4 PROPOSED METHODOLOGY 01
5 ACTION PLAN 02
6 RESOURCE USED 03
7 RATIONALE 04
8 LITERATURE REVIEW 05
9 ACTUAL METHODOLOGY FOLLOWED 06/09
10 OUTPUT OF THE MICROPROJECT 10/12
11 SKILL DEVELOPMENT 13
12 APPLICATIONS 13
MICRO-PROJECT PROPOSAL
TITLE OF MICRO-PROJECT:- 2D SHAPE COLOURING
1.0 AIMS/BENEFITS OF THE MICROPROJECT
• Aim:- The aim of such a project could be to provide a user-friendly interface that allows users to
draw and color various 2D shapes. This can be a fun and educational project, suitable for learning
graphics programming and understanding user interaction with a computer program.
• Benefits of the Project:
1. Educational Value
2. Creativity and Artistic Expression
3. Interactive Learning
4. Visual Feedback
5. Problem-Solving Skills
6. Entertainment and Relaxation
2.0 COURSE OUTCOMES
• Manipulate Visual and geometric information of images.
• Implement standard algorithms to draw various graphics objects using C program.
• Develop programs for 2-D and 3-D Transformations.
• Use projections to visualize objects on view plane.
• Implement various clipping algorithms.
• Develop programs to create curves using algorithms
1
3.0 PROPOSED METHODOLOGY
✓ Understand the Requirements
✓ Design and Plan
✓ Code and Implement
✓ Test and Debug
✓ Iterative Development
✓ Documentation
✓ User Testing
✓ Data Persistence
✓ Additional Features (Optional)
✓ Final Testing and Evaluation
✓ User Training
✓ Project Presentation
✓ Feedback and Refinement
✓ Submission and Sharing
2
4.0ACTION PLANS:
.
Planned
Planned Name of
Sr. Finish
No. Details of activity Responsible
Start date
date Team Members
Select the topic about the
1. 15.09.2023 25.10.2023 ALL
micro-project.
Collect information
2. about our topic. 20.09.2023 30.09.2023 ALL
To understand the concept of
3. topic. 01.10.2023 05.10.2023 ALL
Analysis, coding and
4. debugging 05.10.2023 20.10.2023 ALL
To prepare project
5. Report 25.10.2023 30.10.2023 ALL
3
5.0 RESOURCES REQUIRED:
Sr. Name of Specification Quantity Remarks
resources/material
No.
1. Computer Windows 11 1
2. Internet Youtube/Google
3. Textbook/Manual Computer Graphics 1
4. Software Turbo C
NAME OF TEAM MEMBERS
SR.NO ENROLLMENT NAME OF STUDENT
NO.
1 2211520043 DANDGE KUNAL DIPAK
2 2211520046 DHABADKAR ADESH SHIVAJI
3 2211520057 GUNJAL SACHIN RAMESHWAR
Approved by
Mrs.R.S.Pophale
4
Micro-Project Report
TITLE:- 2D SHAPE COLOURING
1.0 RATIONALE
This course provides an introduction to the principles computer graphics. In particular ,the course will
consider methods for object designs, transformation, scan conversion, visualization and modeling of real
world .The emphasis of the course will be placed on understanding how the various elements that underlie
computer graphics(algebra,geometry,algorithms)interact in the designs of graphics software systems and
also enables student to create impressive graphics easily and efficiently.
2.0 AIMS/BENEFITS OF THE MICROPROJECT
• Aim:- The aim of such a project could be to provide a user-friendly interface that allows users to
draw and color various 2D shapes. This can be a fun and educational project, suitable for learning
graphics programming and understanding user interaction with a computer program.
• Benefits of the Project:
1. Educational Value
2. Creativity and Artistic Expression
3. Interactive Learning
4. Visual Feedback
5. Problem-Solving Skills
6. Entertainment and Relaxation
3.0 COURSE OUTCOMES
• Manipulate Visual and geometric information of images.
• Implement standard algorithms to draw various graphics objects using C program.
• Develop programs for 2-D and 3-D Transformations.
• Use projections to visualize objects on view plane.
• Implement various clipping algorithms.
• Develop programs to create curves using algorithms
5
4.0 LITERATURE REVIEW:
Introduction
It is difficult to display an image of any size on the computer screen. This method is simplified by using
Computer graphics. Graphics on the computer are produced by using various algorithms and techniques.
Introduction to computer graphics:-
Computer Graphics involves technology to access. The Process transforms and presents information in a
visual form. The role of computer graphics insensible. In today life, computer graphics has now become a
common element in user interfaces, T.V. commercial motion pictures .Computer Graphics is the creation of
pictures with the help of a computer. The end product of the computer graphics is a picture it may be a
business graph, drawing, and engineering.
In computer graphics, two or three-dimensional pictures can be created that are used for research. Many
hardware devices algorithm has been developing for improving the speed of picture generation with the
passes of time. It includes the creation storage of models and image of objects.. It is an interactive user can
control the structure of an object of various input devices.
6
1. ACTUAL METHODOLOGY FOLLOWED
PROGRAM CODE
#include <stdio.h>
#include <graphics.h>
#include <conio.h>
#include <math.h>
#include <ctype.h>
#include <dos.h> #define
MAX_SIDES 10inti,r,
choice, x, y, angle;
intxn[MAX_SIDES], yn[MAX_SIDES];
int radius = 100;
intfill_color;
// Xmax=639, Ymax=479
// Function Prototype
voidnewcircle(); void
triangle();
void quadrilateral();
void square();
voidnewrectangle();
void parallelogram();
void rhombus(); void
diamond(); void
trapezium(); void
kite();
void pentagon();
void hexagon();
void heptagon();
void octagon();
void nonagon();
void decagon();
voidnewellipse();
void star();
voiddelayWithAnimation(int milliseconds);
int main()
{
intgd = DETECT, gm;
initgraph(&gd, &gm, "C:\\Turboc++\\BGI");
x = getmaxx() / 2;
y = getmaxy() / 2;
printf(" " );
printf("| 2D_SHAPE_COLOR_FILLING |
");
printf("\n Enter a number according to the desired shape as mentioned below \n");
while (1)
{
printf("\n SHAPES \
n"); 7
printf("\n 1.Circle, 2.Triangle, 3.Square, 4.quadrilateral, 5.Rectangle, 6.Parallelogram , ");
printf("7.Rhombus, 8.Diamond, 9.Trapezium, 10.Kite, 11.Pentagon, 12.Hexagon,");
printf("\n COLORS \
n");
printf("\n 0.Black, 1.Blue, 2.Green, 3.Cyan, 4.Red, 5.Magenta, 6.Brown, 7.Light Gray\n ");
printf("8.Dark Gray, 9.Light Blue, 10.Light Green, 11.Light Cyan, 12.Light Red,\n");
printf(" 13.Light Magenta, 14. Yellow, 15.White, 128.Blink\n");
printf("\n \n"
);
printf("\nEnter your Shape number:");
scanf("%d",&choice);
if (choice == 19)
{
break;
}
printf("\nEnter the fill color (0-15,128):");
scanf("%d",&fill_color);
switch (choice) {
case 1:
newcircle();
break;
case 2:
triangle();
break;
case 3:
square();
break;
case 4:
quadrilateral();
break;
case 5:
newrectangle();
break;
case 6:
parallelogram();
break;
case 7:
rhombus();
break; case
8:
diamond();
break; case
9:
trapezium();
break;
case 10:
kite();
break;
case 11:
pentagon();
break;
8
case 12:
hexagon();
break; case
heptagon();
break;
case 14:
octagon();
break; case
15:
nonagon();
break; case
16:
decagon();
break; case
17:
star();
break; case
18:
newellipse();
break;
default:
printf("Invalid choice. Please enter a valid number.\n");
break;
}
getch();
cleardevice();
}
closegraph();
return 0;
}
voiddelayWithAnimation(int milliseconds)
{
int frames = milliseconds / 100;
for ( i=0 ; i<frames ;i++)
{
delay(1000);
cleardevice();
}
}
voidnewcircle()
{
setcolor(fill_color);
setfillstyle(SOLID_FILL,fill_color);
circle(x, y, radius);
for(r=0; r<radius; r++)
{
delay(50);
circle(x,y,r);
floodfill(x,y,fill_color);
}
delay(1000);
} 9
void triangle()
{
setcolor(fill_color);
setfillstyle(SOLID_FILL,fill_color);
line( x,y,x-150,y+150);
line(x,y,x+150,y+150);
line(x-150,y+150,x+150,y+150);
for( i=0; i<150 ;i++)
{
delay(50);
line( x,y,x-i,y+i);
line(x,y,x+i,y+i);
line(x-i,y+i,x+i,y+i);
floodfill(x,y,fill_color);
}
delay(1000);
}
void quadrilateral()
{
setcolor(fill_color);
setfillstyle(SOLID_FILL,fill_color);
line(x-80,y-80,x+100,y-100);
line(x-80,y-80,x-100,y+70);
line(x-100,y+70,x+100,y+70);
line(x+100,y-100,x+100,y+70);
floodfill(x,y,fill_color);
delay(1000);
}
void square()
{
setcolor(fill_color);
setfillstyle(SOLID_FILL,fill_color);
line(x-80,y-80,x+80,y-80);
line(x-80,y-80,x-80,y+80);
line(x-80,y+80,x+80,y+80);
line(x+80,y-80,x+80,y+80);
for(i=0;i<80;i++)
{
delay(50);
line(x-i,y-i,x+i,y-i);
line(x-i,y-i,x-i,y+i);
line(x-i,y+i,x+i,y+i);
line(x+i,y-i,x+i,y+i);
floodfill(x,y,fill_color);
}
delay(1000);
}
voidnewrectangle()
{
setcolor(fill_color);
setfillstyle(SOLID_FILL,fill_color);
line(x-80,y-80,x+165,y-80);
10
line(x-80,y-80,x-80,y+80);
line(x-80,y+80,x+165,y+80);
line(x+165,y-80,x+165,y+80);
floodfill(x,y,fill_color);
delay(1000);
}
void parallelogram()
{
setcolor(fill_color);
setfillstyle(SOLID_FILL,fill_color);
line(x-80,y-80,x+165,y-80);
line(x-80,y-80,x-130,y+80);
line(x-130,y+80,x+115,y+80);
line(x+165,y-80,x+115,y+80);
for(i=0;i<80;i++)
{
delay(50);
line(x-i,y-80,x+165,y-80);
line(x-i,y-80,x-130,y+80);
line(x-130,y+80,x+115,y+80);
line(x+165,y-80,x+115,y+80);
floodfill(x,y,fill_color);
}
delay(1000);
}
void rhombus()
{
setcolor(fill_color);
setfillstyle(SOLID_FILL,fill_color);
line(x-80,y-80,x+80,y-80);
line(x-80,y-80,x-120,y+80);
line(x-120,y+80,x+40,y+80);
line(x+80,y-80,x+40,y+80);
for(i=0;i<80;i++)
{
delay(50);
line(x-i,y-80,x+80,y-80);
line(x-i,y-80,x-120,y+80);
line(x-120,y+80,x+40,y+80);
line(x+80,y-80,x+40,y+80);
floodfill(x,y,fill_color);
}
delay(1000);
}
void diamond()
{
setcolor(fill_color);
setfillstyle(SOLID_FILL,fill_color);
line(x,y-100,x-120,y+50);
line(x,y-100,x+120,y+50);
line(x,y+200,x-120,y+50);
line(x,y+200,x+120,y+50);
for(i=0;i<50;i++)
{
delay(50); 11
line(x,y-100+i*2,x-120+i,y+50);
line(x,y-100+i*2,x+120-i,y+50);
line(x,y+200-i*2,x-120+i,y+50);
line(x,y+200-i*2,x+120-i,y+50);
floodfill(x,y,fill_color);
}
delay(1000);
}
void trapezium()
{
setcolor(fill_color);
setfillstyle(SOLID_FILL,fill_color);
line(x-80,y-80,x+165,y-80);
line(x-80,y-80,x-130,y+80);
line(x-130,y+80,x+215,y+80);
line(x+165,y-80,x+215,y+80);
for(i=0;i<80;i++)
{
delay(50);
line(x-i,y-80,x+165,y-80);
line(x-i,y-80,x-130,y+80);
line(x-130,y+80,x+215,y+80);
line(x+165,y-80,x+215,y+80);
floodfill(x,y,fill_color);
}
delay(1000);
}
void kite()
{
setcolor(fill_color);
setfillstyle(SOLID_FILL,fill_color);
line(x,y-100,x-95,y+20);
line(x,y-100,x+95,y+20);
line(x,y+200,x-95,y+20);
line(x,y+200,x+95,y+20);
for(i=0;i<100;i++)
{
delay(50);
line(x,y-100+i,x-95+i,y+20);
line(x,y-100+i,x+95-i,y+20);
line(x,y+200-i,x-95+i,y+20);
line(x,y+200-i,x+95-i,y+20);
floodfill(x,y,fill_color);
}
delay(1000);
}
voidnewellipse()
{
setcolor(fill_color);
setfillstyle(SOLID_FILL,fill_color);
ellipse(x, y, 0, 360, 200, 60);
for(i=0;i<=360;i+=10)
{
delay(40); 12
pieslice(x,y,0,i,200);
floodfill(x,y,fill_color);
}
delay(1000);
}
voiddrawPolygon(int x, int y, int radius, int sides)
{
if (sides < 3 || sides > MAX_SIDES)
{
printf("Invalid number of sides for a polygon\n");
return;
}
angle = 360 / sides;
for ( i = 0; i < sides ; i++)
{
xn[i] = x + radius * cos(i * angle * 3.14159265 / 180);
yn[i] = y + radius * sin(i * angle * 3.14159265 / 180);
}
for(i=0; i < sides - 1; i++)
{
line(xn[i], yn[i], xn[i + 1],yn[i + 1]);
}
line(xn[sides - 1], yn[sides - 1], xn[0], yn[0]);
setfillstyle(1,fill_color);
floodfill(x,y,fill_color);
delay(1000);
}
void pentagon() {
int sides = 5; // Number of sides for a pentagon
setcolor(fill_color);
drawPolygon(x, y, radius, sides);
}
void hexagon() {
int sides = 6; // Number of sides for a hexagon
setcolor(fill_color);
drawPolygon(x, y, radius, sides);
}
void heptagon() {
int sides = 7; // Number of sides for a heptagon
setcolor(fill_color);
drawPolygon(x, y, radius, sides);
}
void octagon() {
13
int sides = 8; // Number of sides for an octagon
setcolor(fill_color);
drawPolygon(x, y, radius, sides);
}
void nonagon() {
int sides = 9; // Number of sides for a
nonagonsetcolor(fill_color);
drawPolygon(x, y, radius, sides);
}
void decagon() {
int sides = 10; // Number of sides for a
decagonsetcolor(fill_color);
drawPolygon(x, y, radius, sides);
}
void star()
{
setcolor(fill_color
);
setfillstyle(1,14);
line(300,65,150,2
75);
line(300,65,450,2
75);
line(150,275,450,
275);
floodfill(305,105,fill_color);
line(150,145,300,
360);
line(150,145,450,
145);
line(300,360,450,
145);
floodfill(195,185,fill_c
olor);
floodfill(395,185,fill_c
olor);
floodfill(305,350,fill_c
olor);delay(1000);
}
14
6.0 ACTUAL RESOURCES USED:
Sr. No. Name of Resource/Material Specifications Qty Remarks
1 Windows 11 Intel Core i5 1
2 Text book/Manual Computer 1
Graphics
3 Turbo C/C++ 1
7.0 OUTPUT OF THE MICROPROJECT
15
16
8.0 SKILL DEVELOPED /LEARNING OUTCOME OF THIS MICROPROJECT
1. Communication
2. Leadership
3. Team management
4. Negotiation
5. Personal organization
6. Risk management
7. Critical thinking
9.0 APPLICATIONS OF MICROPROJECT
1. APPLICATIONS OF MICRO - PROJECT
• Education and Training
• Computer Generated Maps
• Presented Graphics
• Computer Art
• Entertainment
• Visualization
• Educational Software
To be Approved by the Concerned Teacher:Mrs.R.S.Pophale
DEPARTMENT OF COMPUTER
ENGINEERING
17