b-init / ImagePaste

A simple Blender addon to grab images from your clipboard and paste as a reference image in viewport or onto the image editor.
GNU General Public License v3.0
246 stars 9 forks source link

Add win32 for Windows clipboard #34

Open thanhph111 opened 2 years ago

b-init commented 2 years ago

Here are some documentation and resources I used while making clipette:

win32 clipboard functions win32 memory management functions CF_HDROP format ctypes wintypes reference ctypes docs bitmap image file structure

This is a very crude way of using the clipboard and python doesn't know what's going on when dealing with these win32 modules so error management might end up being a challenge. If any of the win32 functions spit any error, we must use GetLastError to access it but I haven't implemented that so far.

Also, if we use open_clilpboard() and not close it, it'll make the clipboard unusable for any other program. So we need to be more careful with that.