Giter Site home page Giter Site logo

paint-tool's Introduction

Paint

This program is a simple paint tool which is similar to the Paint of Microsoft. It is written in the language C++ with OpenGL/GLUT.

Preview

Installation

Download all files.

Controls

Under the folder of all resources, run the program: make paint or make.

Mouse event:

Right click -> show menu. Left click -> choose option.

Menu:

  1. Colour -> You can choose Red, Green, Blue, Yellow or Random, the default color is Red.
  2. Shapes -> The default shape is Point.
    • Point -> draw a dot at the point clicked with the mouse. Clicking and dragging will draw points constantly like free-form drawing.
    • Line -> draw a linebetween two subseauently clicked points. (Bresenham's algorithm is used here.)
    • Rectangle -> draw a rectangle with top-left corner specified by the first click and the bottom-right corner specified by a second click. If the second click is bottom-left, top-right or top-left comparing to the first click, a warning will show in the console.
    • Circle -> draw a circle centered at the position of the first click, with its radius set by a second click.
    • Airbrush -> draw multiple points as brush around the clicked point. There are four options of size.
  3. Radical Paint Brush -> draw multiple points as brush around the centre point of the document. You can choose True or False. Only useful when shape is point. The default option is false. After choosing point in shape, it becomes False.
  4. Eraser -> erase the points by clicking and dragging.
  5. Undo -> undo, the history can keep maximum 20 records.
  6. Redo -> redo, the history can keep maximum 20 records.
  7. Clear -> clear all the points and clear the history.
  8. Quit -> close the window.

Keyboard events:

  1. q or esc -> close the window.
  2. c -> clear all the points and clear the history.
  3. + -> larger size of eraser or brush.
  4. - -> smaller size of eraser or brush.
  5. u -> undo, the history can keep maximum 20 records.
  6. r -> redo, the history can keep maximum 20 records.

paint-tool's People

Contributors

emilieczq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.