DEV Community

kayYOLO
kayYOLO

Posted on

[Python]Control MS paint to draw a pixel style logo automatically

From:
Image description
To:
Image description

  1. Firt of all, perpare a simple piture.
  2. Install Python package:

    • pip install opencv-python
    • pip install clicknium > opencv-python: CV library. Load image and convert to a pixel style graph. > clicknium: Automation library. Lanch MS paint and control the mouse to pain the picture.
  3. Search and install clicknium in VS Code extension market.

    Image description

  4. Get the source code
    git clone https://github.com/automation9417/mspaint-draw-img.git

  5. Use VS Code to open the souce code folder and press F5to run. Use Shift+F5 to stop.

You can also build your own automation task using Clicknium. This tool is very easy to use. You can use the Recorder to Capture UI element for both Windows applications and web browser. It will auto-generate the locator to help you to locate and control the UI elements.

The Python script can also be package to a executable file and send to other people. Draw a something special or type some words that you want to speak to the one.

More detial please check the doc

Top comments (0)

Timeless DEV post...

How to write a kickass README

Arguably the single most important piece of documentation for any open source project is the README. A good README not only informs people what the project does and who it is for but also how they use and contribute to it.

If you write a README without sufficient explanation of what your project does or how people can use it then it pretty much defeats the purpose of being open source as other developers are less likely to engage with or contribute towards it.