Page 1 of 2
How to take a screenshot and send it by email?
Posted: Thu Mar 31, 2022 6:46 pm
by liveCode
I want to make a button that captures the screen
This is the code I have in the meantime:
export snapshot from rect the rect of this stack to file "/Users/XXX/Downloads/yourFileHere.png" as JPEG
The problem is I do not know how to make it send an email
Can someone help me?
Re: How to take a screenshot and send it by email?
Posted: Thu Mar 31, 2022 8:06 pm
by dunbarx
Hi.
Never needed to do this, but there are discussion on this forum that will likely help you. Just a quick search found this:
viewtopic.php?f=8&t=36765&p=213163&hilit=email#p213163
Craig
Re: How to take a screenshot and send it by email?
Posted: Thu Mar 31, 2022 8:24 pm
by liveCode
But I could not attach a screenshot
Re: How to take a screenshot and send it by email?
Posted: Fri Apr 01, 2022 1:37 pm
by simon.schvartzman
Are you using mobileComposeMail? There are good examples in the dictionary...
As a suggestion it is always a good practice to share your code (and errors) when posting a question like this. It will help "helpers" to be able to help.
Best
Re: How to take a screenshot and send it by email?
Posted: Fri Apr 01, 2022 2:00 pm
by Klaus
And maybe you want to think this over:
...yourFileHere.
png" as
JPEG

Re: How to take a screenshot and send it by email?
Posted: Sun Apr 03, 2022 6:40 pm
by liveCode
This is my code:
Code: Select all
on mouseUp
// export snapshot from rect the rect of this stack to image "AuxImg" as JPEG
export snapshot from this cd to image "AuxImg" as PNG
// put img "AuxImg" into img "a" of cd "a"
// go card "a"
put image "AuxImg" into tAttachment ["data"]
put "image / jpg" into tAttachment ["type"]
put "my picture" into tAttachment ["name"]
mobileComposeMail "Imagem Capturada", ,,,, tAttachment
end mouseUp
The problem is that he gives this picture
And it's not the whole screen
Re: How to take a screenshot and send it by email?
Posted: Sun Apr 03, 2022 7:21 pm
by Klaus
Try this:
Code: Select all
...
export snapshot from rect (the screenrect) to image "AuxImg" as PNG
...
Re: How to take a screenshot and send it by email?
Posted: Wed Apr 06, 2022 12:41 pm
by liveCode
Now it's better.
But still not the way I want
Attaches a screenshot of how it is now and how I want it to be
(The problem is that there is some black color up then you do not see the whole field of the version)
Re: How to take a screenshot and send it by email?
Posted: Wed Apr 06, 2022 1:03 pm
by Klaus
The first screenshot is from the desktop version, and the second from the phone, right?
Well, you can only screenshot what is displayed!
What fullscreenmode are you using for your app?
Re: How to take a screenshot and send it by email?
Posted: Wed Apr 06, 2022 1:17 pm
by liveCode
The first screenshot is from the desktop version, and the second from the phone, right?
yes
Did you mean that?
Code: Select all
set the fullscreenmode of me to "exactFit"
If so this is the code I put
Re: How to take a screenshot and send it by email?
Posted: Wed Apr 06, 2022 1:22 pm
by Klaus
Yes.
Hm, "exactfit" should actually show everything?
Try "letterbox" and screenshot again.
But remember, if the screen looks ugly on the phone, the screenshot will look ugly, too!

Re: How to take a screenshot and send it by email?
Posted: Wed Apr 06, 2022 1:23 pm
by Klaus
Maybe you want to change the "hilitecolor" of your button "Button to a brighter color, so it looks a little less ugly.
Re: How to take a screenshot and send it by email?
Posted: Wed Apr 06, 2022 1:27 pm
by liveCode
In a few hours I'll try what you said (the phone is not with me now)
What is the original RGB of the button and background?
Re: How to take a screenshot and send it by email?
Posted: Wed Apr 06, 2022 1:28 pm
by Klaus
Hm, ask the INSPECTOR!

Re: How to take a screenshot and send it by email?
Posted: Wed Apr 06, 2022 6:03 pm
by jacque
To me, it looks like the field isn't wide enough to show a longer date. "Tuesday" is shorter than "Wednesday" so Wednesday doesn't fit. The fix is to turn off the bold property and if that doesn't work then use a shorter date format. Mobile fonts are not the same as desktop fonts and will display differently.
Edit : I see you mean the bottom of the stack is cut off. Usually "showAll" works.