Question
Save Image from Clipboard
Hi, community.
I am developing an automation where I must take a screenshot and then save it in a .jpg file.
Right now, I am able to take the screenshot and get the image within a script. I tried to saved it in the same script but I wasn't able to achieve it. That is why I decided to use pega in order to save it, using the imageProxy.
Attached you can see the automation, the script and the error which is displayed when run.
The fact is that I was able to paste it in a paint file, so the image is there.
What do you recommend? Thanks in advance.
**Moderation Team has archived post**
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
Are you certain that your image is being captured. Try checking Clipboard.ContainsImage first. In my tests, if I did an Alt+Print Screen first, then this was True, otherwise, if I copied some text, it was false. I suspect your SendKeys is the issue. Perhaps there is also a short time lag required between sending the keys to capture the image and it appearing on the clipboard. Try separating the two operations with different buttons (i.e. click on the capture the image, and click another to get the screenshot and save it).