2021-06-03 17:47:12 -05:00
|
|
|
|
2021-06-03 22:09:34 -05:00
|
|
|
For Draw
|
2021-06-03 17:47:12 -05:00
|
|
|
-----------------
|
|
|
|
|
2021-06-03 18:28:37 -05:00
|
|
|
Save image from clipboard
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^
|
2021-06-03 17:47:12 -05:00
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
2021-06-03 18:28:37 -05:00
|
|
|
def save_image_from_clipboard():
|
2021-06-03 17:47:12 -05:00
|
|
|
# Target path
|
|
|
|
path = '/home/mau/Pictures'
|
|
|
|
|
|
|
|
# Open new hidden Draw doc
|
|
|
|
doc = app.docs.new('draw', {'Hidden': True})
|
|
|
|
|
|
|
|
# Paste image from clipboard and return
|
|
|
|
image = doc.paste()
|
|
|
|
|
|
|
|
# Save image
|
|
|
|
image.save(path)
|
|
|
|
|
|
|
|
# Close document
|
|
|
|
doc.close()
|
|
|
|
|
|
|
|
app.msgbox('Image saved')
|
|
|
|
return
|