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: 119
Joined: Sun Oct 17, 2021 5:53 pm

How to take a screenshot and send it by email?

Post by liveCode » Thu Mar 31, 2022 6:46 pm

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: 9665
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

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

Post by dunbarx » Thu Mar 31, 2022 8:06 pm

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: 119
Joined: Sun Oct 17, 2021 5:53 pm

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

Post by liveCode » Thu Mar 31, 2022 8:24 pm

But I could not attach a screenshot

simon.schvartzman
Posts: 641
Joined: Tue Jul 29, 2014 12:52 am
Location: Brazil

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

Post by simon.schvartzman » Fri Apr 01, 2022 1:37 pm

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 ";" or not to ";" that is the question

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

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

Post by Klaus » Fri Apr 01, 2022 2:00 pm

And maybe you want to think this over:
...yourFileHere.png" as JPEG
8)

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

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

Post by liveCode » Sun Apr 03, 2022 6:40 pm

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: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

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

Post by Klaus » Sun Apr 03, 2022 7:21 pm

Try this:

Code: Select all

...
export snapshot from rect (the screenrect) to image "AuxImg" as PNG
...

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

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

Post by liveCode » Wed Apr 06, 2022 12:41 pm

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
gg.png
That's how I want it to be
my picture (2).png
That's not how I want it to be

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

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

Post by Klaus » Wed Apr 06, 2022 1:03 pm

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: 119
Joined: Sun Oct 17, 2021 5:53 pm

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

Post by liveCode » Wed Apr 06, 2022 1:17 pm

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: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

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

Post by Klaus » Wed Apr 06, 2022 1:22 pm

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: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

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

Post by Klaus » Wed Apr 06, 2022 1:23 pm

Maybe you want to change the "hilitecolor" of your button "Button to a brighter color, so it looks a little less ugly.

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

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

Post by liveCode » Wed Apr 06, 2022 1:27 pm

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: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

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

Post by Klaus » Wed Apr 06, 2022 1:28 pm

Hm, ask the INSPECTOR! :D

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7237
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

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

Post by jacque » Wed Apr 06, 2022 6:03 pm

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

Return to “Getting Started with LiveCode - Experienced Developers”