DEV Community


Posted on

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

Image description
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

  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)