Skip to content

spenceryonce/AutoDrawPaintNet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

AutoDrawPaintNet

I've been playing around with pyautogui since yesterday and had some fun drawing by using the drag mouse functions in pyautogui and using the win32api library with win32con for the input as I have found that it is much faster than using pyautogui's.

The boxes.py is a super simple example of drawing quite literally a box with pyautogui.

The circles.py is also very basic, to showcase the concept. The rest is left up to your imagination and implementation.

Note that while all of this is made for Paint.NET, you could this is any painting/drawing app, you just need to find the mouse position when you hover over the position of certain elements on your screen.

SETUP

  1. Open Paint.NET

  2. Open the color wheel

  3. Create new Document and layer and fill it with solid white (or whatever suits your preference)

  4. open up a python shell or however you prefer running python quickly, use the pyautogui's command for grabbing mouse pos: pyautogui.mouseDisplayPosition() which will return somethings like this: {X:234, Y: 333, {r:255,g:45,b:255}}

  5. Go around Paint.NET and find the x,y for 4 colors on color wheel, Red, Green, Cyan, and Purple, which are the four corners of the circle if perpendicular to the side of your monitor.

  6. Sample the top left corner of your blank white canvas for its x,y coords (if you want to make it easy and not have to adjust the spacing for boxes to draw correct, you are welcome to use the same canvas same as I did: 800 x 600. That way, the program already knows what it's working with)

  7. If you didn't use my resolution, you will need to adjust amount of offsetx and offsety which can take a bit of playing around with to get right. (Huge tip though is to temporailt change the amount offsetx is multiplied within the while loop in the function loop in main.py. I would just set it to 1 or 2 so that if you don't get you coords correct you won't mess up other things on your screen.

  8. Last thing I'll mention is at any point when it's running (almost any point, but almost enough, at least for now) you can hold q to halt the app from drawing and potential destroying whatever you had close to it. (I've done this, it's funny when it doesn't accidentally move a ton of files to you recyle bin if it happens to be on your desktop. So just be on the safe side and use q when before it starts to get out of hands and go all over the place, unless, well, that's your sort of thing.)

** This is super limited and basic right now, but if you are new to pyautogui, it make be a fun intro into making something that I also enjoyed messing around with. **

Feel free to submit pullrequest to add to this repo as well. I'll be quite responsive so just let me know!

Have fun!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages