How to take a screenshot and send it by email?

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

liveCode
Posts: 124
Joined: Sun Oct 17, 2021 5:53 pm

How to take a screenshot and send it by email?

Post 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?
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10501
Joined: Wed May 06, 2009 2:28 pm

Re: How to take a screenshot and send it by email?

Post 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
liveCode
Posts: 124
Joined: Sun Oct 17, 2021 5:53 pm

Re: How to take a screenshot and send it by email?

Post by liveCode »

But I could not attach a screenshot
simon.schvartzman
Posts: 672
Joined: Tue Jul 29, 2014 12:52 am

Re: How to take a screenshot and send it by email?

Post 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
Simon
________________________________________
To "AI", or not to "AI", that is the question
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: How to take a screenshot and send it by email?

Post by Klaus »

And maybe you want to think this over:
...yourFileHere.png" as JPEG
8)
liveCode
Posts: 124
Joined: Sun Oct 17, 2021 5:53 pm

Re: How to take a screenshot and send it by email?

Post 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
Attachments
ללא שם.png
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: How to take a screenshot and send it by email?

Post by Klaus »

Try this:

Code: Select all

...
export snapshot from rect (the screenrect) to image "AuxImg" as PNG
...
liveCode
Posts: 124
Joined: Sun Oct 17, 2021 5:53 pm

Re: How to take a screenshot and send it by email?

Post 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)
Attachments
That's how I want it to be
That's how I want it to be
That's not how I want it to be
That's not how I want it to be
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: How to take a screenshot and send it by email?

Post 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! 8)

What fullscreenmode are you using for your app?
liveCode
Posts: 124
Joined: Sun Oct 17, 2021 5:53 pm

Re: How to take a screenshot and send it by email?

Post 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
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: How to take a screenshot and send it by email?

Post 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! :D
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: How to take a screenshot and send it by email?

Post by Klaus »

Maybe you want to change the "hilitecolor" of your button "Button to a brighter color, so it looks a little less ugly.
liveCode
Posts: 124
Joined: Sun Oct 17, 2021 5:53 pm

Re: How to take a screenshot and send it by email?

Post 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?
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: How to take a screenshot and send it by email?

Post by Klaus »

Hm, ask the INSPECTOR! :D
jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7423
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: How to take a screenshot and send it by email?

Post 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.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
Post Reply