28 lines
510 B
ReStructuredText
28 lines
510 B
ReStructuredText
|
|
For Draw
|
|
-----------------
|
|
|
|
Save image from clipboard
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
.. code-block:: python
|
|
|
|
def save_image_from_clipboard():
|
|
# 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
|