GithubHelp home page GithubHelp logo

sidneyteodorojr / digital_whiteboard Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 59 KB

This Python script creates a simple whiteboard application with a graphical interface using the tkinter library.

Python 100.00%
python tkinter

digital_whiteboard's Introduction

Digital Whiteboard


Digital Whiteboard


This Python script creates a simple whiteboard application with a graphical interface using the tkinter library. The application allows the user to draw lines on a virtual whiteboard, choose pen colors, import images and adjust line thickness with a slider. Here is a description of the main parts of the script:

Library Import:

The script starts by importing several tkinter libraries to create the graphical interface, manipulate colors, work with files, and perform other graphical tasks.

Main Window Configuration:

A main window is created using tk.Tk(), with a title ("WHITE BOARD"), fixed size and background color set.

Drawing Manipulation Functions

. locate_xy(event): Records the mouse coordinates when the button is pressed.

. addline(event): Draws a line on the screen between the previously recorded coordinates and the current mouse coordinates.

. show_color(new_color): Updates the pen color.

. new_canvas(): Cleans the whiteboard, removing all drawings.

. insertimage(): Allows the user to select and insert an image into the whiteboard, which can be dragged.

. my_callback(event): Moves the inserted image to the mouse position when the right mouse button is pressed and dragged.

Icons and Graphical Interface

. Icons and buttons are added to the main window for functions such as clearing the whiteboard and importing images.

. A color palette is displayed in the left part of the window, allowing the user to choose the pen color.

Main screen

. A canvas (Canvas) is created in the center of the main window, where the user can draw.

. Mouse events (click and drag) are linked to drawing functions.

Main Loop

The main loop (root.mainloop()) is started to run the GUI and wait for user interaction.

In summary, this script creates a simple whiteboard application with basic drawing features, image import, and control of drawing line color and thickness. It's a great base for building a more complex painting or note-taking application.

Contributions

Contributions are welcome! If you want to improve the project, add new features or fix problems, feel free.



digital_whiteboard's People

Contributors

sidneyteodorojr avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.