Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a Remote Screenshot #105

Merged
merged 6 commits into from
May 29, 2024
Merged

Conversation

53845714nF
Copy link
Contributor

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.

…l screenshot, except that it outputs the image as Base64 String
@faaxm
Copy link
Owner

faaxm commented May 14, 2024

I like the functionality, but am wondering about the "Remote" naming, which seems to be specific to your use case. However one could also use it in a GTest running locally, where the base64 string is just compared with an expected value. Then, nothing "remote" would be involved.

Could we rename it to something that more describes what it does, rather than how it could be used? Though I'm also not sure what a good name would be.... Maybe something like takeScreenshotAsString? or takeScreenshotAsBase64?

What do you think @53845714nF ?

@faaxm faaxm self-assigned this May 14, 2024
@53845714nF
Copy link
Contributor Author

Sorry that I am writing so late, I am a little ill.

That sounds fine to me, I can fully understand that.

@faaxm
Copy link
Owner

faaxm commented May 20, 2024

Sorry that I am writing so late, I am a little ill.

That sounds fine to me, I can fully understand that.

Cool, then what about we go with takeScreenshotAsBase64? Could you do the renaming once you're fully recovered? Until then, "Gute Besserung"!

53845714nF and others added 3 commits May 23, 2024 15:19
* MacOS 14 only supports Arm64 but Qt5 not, so I pin it to macOS 13 on Qt5.
* Bump Checkout Action from 3 to 4, because it uses an old Node Version.
* Adding an extra test case for macOS, because on macOS 14 with Qt6 the -platform minimal is not supported.

---------

Co-authored-by: Sebastian Feustel <[email protected]>
Co-authored-by: Falko Axmann <[email protected]>
…xm#103)

* Add new parameters (proportion and offset) to the mouse Click. It will be possible to click e.g. sliderarea at certain positions.
* Create a new GTest for Mouse Click Position
* Update examples/GTestMouseClickPosition/main.cpp

---------

Co-authored-by: Sebastian Feustel <[email protected]>
Co-authored-by: Falko Axmann <[email protected]>
@53845714nF 53845714nF force-pushed the add_screenshot_remote branch 2 times, most recently from 9f7047c to b4c63aa Compare May 23, 2024 13:22
@53845714nF 53845714nF force-pushed the add_screenshot_remote branch from b4c63aa to e500bd9 Compare May 23, 2024 13:26
@53845714nF
Copy link
Contributor Author

Thank you very much, I'm still not completely healthy, but I've got to work on it now. I think there are some viruses going around in Germany, so take care.

I pulled the branch to the current master branch, so it looks like there are 5 new commits, but there are actually only two new ones. The last one is the one where I renamed the function. It would be good if the PR became one commit, but I think GitHub does that automatically.

@faaxm faaxm closed this May 29, 2024
@faaxm faaxm reopened this May 29, 2024
@faaxm faaxm merged commit b948a34 into faaxm:master May 29, 2024
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants