0% found this document useful (0 votes)
2 views

pythonfinal

The document is a project report on a Basic Drawing Application developed using Python's Tkinter library, aimed at providing a user-friendly interface for drawing. It outlines the rationale, aims, methodology, and outcomes of the project, highlighting skills developed and potential applications. Future enhancements include adding more drawing tools, saving functionalities, and mobile compatibility.

Uploaded by

rutujakawade03
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

pythonfinal

The document is a project report on a Basic Drawing Application developed using Python's Tkinter library, aimed at providing a user-friendly interface for drawing. It outlines the rationale, aims, methodology, and outcomes of the project, highlighting skills developed and potential applications. Future enhancements include adding more drawing tools, saving functionalities, and mobile compatibility.

Uploaded by

rutujakawade03
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

A

Project Report On
“Basic Drawing Application”

Submitted In Partial Fulfillment of Requirement


For The Award Of
Diploma In Computer Engineering Of Government Polytechnic, Dharashiv
Affiliated To

Maharashtra State Board of Technical Education


Submitted By
Masiha Silviya Santosh
Under the guidance of

Mr. A.B. Gaikwad

Department of Computer Engineering


Government Polytechnic College, Dharashiv
MAHARSHTRA STATE BOARD OF
TECHNICAL EDUCATION

CERTIFICATE

Government Polytechnic Dharashiv

This is to certify that Ms. Masiha Silviya Santosh Roll No. 32 of 6th Semester of diploma
in Computer engineering has completed the term work satisfactorily in Programming
with python ( ) For academic year 2024-2025 as prescribed in the curriculum.

Place: Dharshiv Enrolment No: 2201180062

Date: Seat No: 426165

Subject Teacher Head of Department Principal

Mr. A. B. Gaikwad Mr. A. B. Gaikwad Mr. S. L. Andhare


GOVERNMENT POLYTECHNIC DHARASHIV

ACKNOWLEDGMENT

The success and final outcomes of this project required substantial guidance and assistance from
many individuals, and I feel privileged to have received their support throughout the process. My
achievements are a direct result of their supervision, and I want to express my gratitude.

I am especially thankful to my project guide, Mr. A.B. Gaikwad sir, and the Head of the Computer
Department. Their keen interest in my work and consistent guidance were instrumental in
navigating the challenges I faced. I greatly appreciate their valuable insights and unwavering
support, which were crucial to the successful completion of my project.

I would also like to thanks to our principal Mr. Andhare sir who gave me the golden opportunity
to do thiswonderfulprojectthathelped meindoing alot of research and I came to know about so
many new things. Lastly, I thank the Almighty, my parents, and my classmates for their constant
encouragement, without which this assignment would not have been possible.

Your Sincerely,

Masiha Silviya

Basic Drawing Application


GOVERNMENT POLYTECHNIC DHARASHIV

INDEX

Content

1. Rationale.........................................................................................5
2. Aim of the micro project.................................................................5
3. Course outcomes addressed............................................................5
4. Literature review
1. Steps For Project Implementation..................6
2. Program……………………………………....8
3. Explanation of Program…………………....9
5. Actual Methodology………………………………………….…11
6. Actual Resources required…………………………....................13
7. Output of the Project ................................................................ 14
8. Skill developed/learning out of this micro project………….....15
9. Application of the Project..........................................................16
10. Conclusion ................................................................................ 17
11. Future Scope ............................................................................. 17
12. References ................................................................................ 18

Basic Drawing Application


GOVERNMENT POLYTECHNIC DHARASHIV

MICRO PROJECT REPORT


Basic Drawing Application
1.0 Rationale:

The drawing application is designed for simplicity and ease of use. Users can draw lines, choose
colors, and clear the canvas with minimal effort. The interface is intuitive, allowing real-time
interaction through mouse clicks. For developers, the app’s code is modular, separating drawing
functionality from control elements like buttons. This makes the code cleaner and easier to
maintain. The design is flexible, allowing for easy extension by adding new shapes through a
simple interface, making future updates straightforward.

2.0 Aim/Benefits of the Micro Project:

The aim of this Drawing Application project is to develop an intuitive and user-friendly tool that
enables users to create and manage their drawings effortlessly. The application allows users to
draw lines on a canvas, select colours, and clear their work with ease. By offering simple mouse
interactions and minimal controls, the system ensures that users can focus on the creative process
without being distracted by complex features or settings. This project benefits users by providing
a seamless and enjoyable drawing experience, while also offering flexibility for future
improvements or feature additions.

3.0 Course Outcomes Achieved:


 Developed programs using GUI framework (Tkinter in Python).

 Handled user events such as mouse actions and button clicks.

 Applied object-oriented programming concepts to design interactive applications.

5
GOVERNMENT POLYTECHNIC DHARASHIV

4.0 Literature Review:

The Drawing Application focuses on simplicity, allowing users to draw, select colors, and clear
the canvas with ease, prioritizing creativity over complexity. For developers, its modular design
ensures maintainability and scalability. Components like the drawing and control panels, along
with the Shape interface, make adding new features straightforward. The efficient use of the
Graphics class ensures smooth, real-time rendering, making the app both user-friendly and
adaptable for future updates.

6
GOVERNMENT POLYTECHNIC DHARASHIV

Steps For Project Implementation

Setup:

 Install Python 3.x from python.org.


 Install a text editor like Notepad++ or use an IDE like Visual Studio Code.

Create and Save the File:

 Open Notepad++, create a new file, and paste the Python code.
 Save the file as drawing_application.py in your desired project folder.

Compile and Run:

 Open Command Prompt or Terminal and navigate to the folder where the .py file is
saved.
 Run the Python script using python drawing_application.py or python3
drawing_application.py.

Basic Drawing Application 7


GOVERNMENT POLYTECHNIC DHARASHIV

PROGRAM
 Basic Drawing Application

import tkinter as tk
from tkinter import colorchooser

class DrawingApplication(tk.Tk):
def _init_(self):
super()._init_()
self.title("Simple Drawing Application")
self.geometry("800x600")
self.current_color = "black"
self.shapes = []
self.canvas = tk.Canvas(self, bg="white", width=800, height=550)
self.canvas.pack()
control_panel = tk.Frame(self)
control_panel.pack(side=tk.BOTTOM, fill=tk.X)
clear_button = tk.Button(control_panel, text="Clear", command=self.clear)
clear_button.pack(side=tk.LEFT)
color_button = tk.Button(control_panel, text="Choose Color",
command=self.choose_color)
color_button.pack(side=tk.LEFT)
self.start_point = None
self.canvas.bind("<ButtonPress-1>", self.on_mouse_press)
self.canvas.bind("<B1-Motion>", self.on_mouse_drag)
self.canvas.bind("<ButtonRelease-1>", self.on_mouse_release)
self.lines = []

def on_mouse_press(self, event):


self.start_point = (event.x, event.y)
self.lines.append([self.start_point])

8
GOVERNMENT POLYTECHNIC DHARASHIV

def on_mouse_drag(self, event):


if self.start_point:
self.lines[-1].append((event.x, event.y))
self.draw_shapes()

def on_mouse_release(self, event):


self.start_point = None

def draw_shapes(self):
self.canvas.delete("all")
for line in self.lines:
for i in range(1, len(line)):
self.canvas.create_line(line[i-1], line[i], fill=self.current_color, width=2)

def clear(self):
self.lines.clear()
self.canvas.delete("all")

def choose_color(self):
color = colorchooser.askcolor(color=self.current_color)[1]
if color:
self.current_color = color

if _name_ == "_main_":
app = DrawingApplication()
app.mainloop()

9
GOVERNMENT POLYTECHNIC DHARASHIV

Explanation of Program

Main Application Class (DrawingApplication):

Control Panel:

 Clear Button: Clears the canvas by removing all drawn shapes.

 Choose Color Button: Allows the user to select a drawing color using a color picker dialog
(colorchooser.askcolor()).

 Drawing Panel (DrawPanel): This is the area where the actual drawing happens.

Mouse Events:

The panel listens for mouse press and release events. When the mouse is pressed, the starting
point of the drawing is captured. When the mouse is released, the endpoint is recorded, and a
new line is drawn between the two points.

 Clear Method:

The clear() method removes all shapes from the list, essentially resetting the canvas to a
blank state.

 Shape Interface:

This interface defines a contract for drawable objects. All shapes (e.g., lines) must
implement the draw() method. The interface makes it easy to add new shapes in the future
by simply creating new classes that implement this method (e.g., adding circles or
rectangles).

 Line Class:

The Line class represents a line drawn between two points with a specified color. It
implements the Shape interface and the draw() method, using the create_line() function to
render the line on the canvas.

10
GOVERNMENT POLYTECHNIC DHARASHIV

Main Method:

The main() method initializes the application by calling app.mainloop() to start the event loop
for the GUI. It ensures that the GUI operates smoothly and is thread-safe by using the main
event dispatch loop, which is essential in GUI applications.

Key Features:

 Drawing Lines: Users can click and drag the mouse to draw lines on the canvas.

 Color Selection: The color of the lines can be changed through a color picker dialog.

 Clear Canvas: Users can click the "Clear" button to remove all drawn lines and reset the
canvas.

 Real-time Drawing: The application provides immediate feedback as users draw lines,
ensuring a dynamic and interactive experience.

Design Considerations:

 Modularity: The code is structured into distinct components—drawing functionality in


DrawPanel and control elements in the control panel. This design makes the application
clean, maintainable, and easy to modify.

 Extensibility: The use of the Shape interface allows the addition of new shapes (e.g.,
rectangles, circles) without changing the core application logic. This provides flexibility to
enhance the app with new drawing tools.

 User-Friendly: The application is designed to be simple and intuitive, with basic mouse
interactions and easy-to-understand buttons for color selection and canvas clearing.

11
GOVERNMENT POLYTECHNIC DHARASHIV

4.0 Actual Methodology Followed:


1. Defined the scope: User-friendly Basic Drawing application.
2. Design:

 Used Swing for GUI design.


 Created classes for clear separation of concerns.

3. Implementation:
 Built the application using Java programming

5.0 Actual Resources required:

S.No. Name of Resource/Material Specification Quantity


1 Computer System Hp i3 RAM 8GB 1
Operating System- Windows11
2 Software Python IDE 1

3 Any other resources used Google Chrome -

12
GOVERNMENT POLYTECHNIC DHARASHIV

6.0 Output of the Project:

13
GOVERNMENT POLYTECHNIC DHARASHIV

14
GOVERNMENT POLYTECHNIC DHARASHIV

7.0 Skill developed/learning outcomes of Micro project:


 Gained hands-on experience with Tkinter for GUI development.
 Improved event-driven and object-oriented programming skills.
 Learned to implement drawing features and color selection in Python.

8.0 Application of the project:


The Simple Drawing Application can be utilized in various scenarios, including:
Educational Tools: Assisting students and teachers in creating visual aids, diagrams, and
illustrations.
Creative Work: Providing artists and designers a platform for quick sketches and conceptual
designs.
Presentation Aids: Enabling users to create custom graphics for presentations or reports.
Prototyping: Supporting developers and engineers in drafting simple prototypes or diagrams.
Collaborative Projects: Facilitating brainstorming sessions and collaborative artwork in team
environments.
Personal Use: Allowing casual users to create and save personalized drawings for hobbies or
leisure.

9.0 Conclusion:
The Simple Drawing Application demonstrates the effective use of Python’s Tkinter library to
build an interactive and user-friendly drawing tool. Its clean interface and event-driven design
allow users to draw freely and select colors with ease. The object-oriented structure ensures
the code is organized and maintainable, providing a solid foundation for future improvements
such as shape tools, file saving, and enhanced drawing capabilities. This project highlights the
potential of Python for creating practical GUI-based applications.

10.0 Future scope:

 Integration of additional drawing tools such as shapes and freehand brushes.

 Implementation of undo and redo functionalities for better control.

 Support for saving and exporting drawings in image formats like PNG or JPEG.

 Enhancement of drawing options with advanced color pickers, brush sizes, and gradients.

 Development of a mobile-friendly version for accessibility on various devices.

15
GOVERNMENT POLYTECHNIC DHARASHIV

11.0 References:
 www.geeksforgeeks.com

 www.wikipedia.com

 www.stackoverflow.com

16

You might also like