spix icon indicating copy to clipboard operation
spix copied to clipboard

Add a Remote Screenshot

Open 53845714nF opened this issue 3 months ago • 1 comments

Add a Remote Screenshot Function this creates a screenshot like the normal screenshot, except that it outputs the image as Base64 String. It could be useful for example on embedded devices, where you do not want to save images on the device.

For an Example, use in Python:

session = ServerProxy('http://192.168.178.142:9000')

image_string = session.takeScreenshotRemote('mainWindow/header/burgerMenu')

print("Remote Image:" + str(image_string))

image_data = b64decode(image_string)

with open('burgerMenu.png', 'wb') as f:
    f.write(image_data)

You get:

Remote Image:iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAIAAACRXR/mAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAAnklEQVRYhe3WMQrAIBBEUTek1xvruZJLeQPTS4oZUJxifi3xYRYxxhhJr+s04D+zmMxiMovJLCazmMxiMovpBtdFxJL9wOed6GmJstCfmHPe6pgKv+WJRFnobLXWluwHfgedLd9bKcmy0NmqtW51TPneYhJlobNVSlmyX+8dWeZ7i0mU5QuCySwms5jMYjKLySwmUdb9PO9pw0+ip/UB/cMlMpXl7ngAAAAASUVORK5CYII=

Which reflects in to this image: burger Menu

There you can then see whether the component looks as it is supposed to.

53845714nF avatar Mar 12 '24 14:03 53845714nF