Screenshot of all the objects in the app

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

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

Screenshot of all the objects in the app

Post by liveCode » Wed Feb 23, 2022 7:43 pm

How can I take a screenshot?
I want all objects to be included in this image

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

Re: Screenshot of all the objects in the app

Post by Klaus » Wed Feb 23, 2022 7:57 pm

Hi livecode,

check "import/export snapshot" in the dictionary.


Best

Klaus

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

Re: Screenshot of all the objects in the app

Post by liveCode » Wed Feb 23, 2022 8:42 pm

I tried but it only captures the background and not all the objects

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

Re: Screenshot of all the objects in the app

Post by Klaus » Wed Feb 23, 2022 8:59 pm

What exactly did you try?
Please post your script.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9359
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Screenshot of all the objects in the app

Post by richmond62 » Wed Feb 23, 2022 9:05 pm

Which operating system are you using?

With MacOS and Xubuntu (the 2 systems I use) they have system apps for this sort of thing.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9648
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Screenshot of all the objects in the app

Post by dunbarx » Wed Feb 23, 2022 10:52 pm

Richmond.
With MacOS and Xubuntu (the 2 systems I use) they have system apps for this sort of thing.
I would think that the OP wants LC to do all the picture taking, and not (on Mac) cmd-shift-4.

Craig

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9648
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Screenshot of all the objects in the app

Post by dunbarx » Wed Feb 23, 2022 11:31 pm

Really, what Klaus said about the "export snapshot' command.

Code: Select all

export snapshot from rect the rect of stack "yourStack"  to file "/Users/whoeverYouAre/Desktop/yourFileHere" as JPEG
This will take a picture of the full card window as it is presented on screen.

Craig
Last edited by dunbarx on Thu Feb 24, 2022 2:50 pm, edited 2 times in total.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9359
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Screenshot of all the objects in the app

Post by richmond62 » Thu Feb 24, 2022 8:38 am

viewtopic.php?t=34691

There is also my stack I made in 2001 . . .

I have just tried out that stack and, in my case on MacOS 12, it dumped the screenShot inside
the LiveCode app folder . . .

Stack deleted as per problem mentioned above: better one posted below. 8)
Last edited by richmond62 on Thu Feb 24, 2022 9:20 am, edited 1 time in total.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9359
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Screenshot of all the objects in the app

Post by richmond62 » Thu Feb 24, 2022 9:19 am

SShot 2022-02-24 at 10.17.41.png
SShot 2022-02-24 at 10.17.41.png (6.1 KiB) Viewed 3896 times
-
Stack deleted: better one posted below.
Last edited by richmond62 on Thu Feb 24, 2022 11:08 am, edited 1 time in total.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9359
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Screenshot of all the objects in the app

Post by richmond62 » Thu Feb 24, 2022 9:24 am

Of course, if you wanted a screensnap that wanted ONLY bits of LiveCode
[i.e. NOT the pornographic desktop picture . . . ] you could have the screen snapper
turn on the backdrop.
-
SShot 2022-02-24 at 11.15.45.png
SShot 2022-02-24 at 11.15.45.png (8.33 KiB) Viewed 3879 times
Attachments
snapper.livecode.zip
Stack
(5.4 KiB) Downloaded 77 times

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

Re: Screenshot of all the objects in the app

Post by jacque » Thu Feb 24, 2022 8:35 pm

richmond62 wrote:
Thu Feb 24, 2022 9:24 am
Of course, if you wanted a screensnap that wanted ONLY bits of LiveCode
[i.e. NOT the pornographic desktop picture . . . ] you could have the screen snapper
turn on the backdrop.
That's the hard way. The easy way is:

Code: Select all

export snapshot from this cd to file "testshot.png" as PNG
Note that if you don't specify a complete file path, the image will be saved to the default folder which, on a Mac, is inside the application bundle and on Windows is inside the app folder. So it's better to ask for a path ("ask file") or provide a full path in the script.

Code: Select all

put specialFolderPath("documents") & "/testshot.png" into tPath
export snapshot from this cd to file tPath as PNG
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

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

Re: Screenshot of all the objects in the app

Post by liveCode » Sat Feb 26, 2022 6:24 pm

I created a button and gave it the following code:

Code: Select all

on mouseUp
    // answer folder "Where to export?"
    // lock screen
    go card "gameCard"
    export snapshot from rect the rect of stack "myFirstTamago" to file specialFolderPath ("documents") & "/ Tamago.png" as JPEG
    // unlock screen
    go card "setting"
    answer "The export worked successfully" & cr & "The image is in the documents"
end mouseUp
But it did not work for me
He did not put the image inside the document folder on the phone
How can I solve this problem?

SparkOut
Posts: 2852
Joined: Sun Sep 23, 2007 4:58 pm

Re: Screenshot of all the objects in the app

Post by SparkOut » Sat Feb 26, 2022 7:54 pm

Before checking any code and operation, first thing I see is the word "phone".
Are you expecting the screenshot to be saved in the publicly accessible external documents folder?
The folder specialFolderPath("documents") is sandboxed for each app, and only your LiveCode app will be able to find and access files in it.
You would need to investigate "external documents" (and enable writing to that location in the app's standalone settings if so.
Otherwise, well I have done no checking yet.

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

Re: Screenshot of all the objects in the app

Post by liveCode » Sat Feb 26, 2022 8:00 pm

So how do I save a screenshot inside the documents in my phone?

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

Re: Screenshot of all the objects in the app

Post by jacque » Sat Feb 26, 2022 8:39 pm

liveCode wrote:
Sat Feb 26, 2022 8:00 pm
So how do I save a screenshot inside the documents in my phone?
Unfortunately that isn't available yet. I'm not sure what "external documents" is supposed to be, because it only saves files to the app's private sandbox. I submitted a bug/feature request because my app also needs to access a public folder.
https://quality.livecode.com/show_bug.cgi?id=23526

However, I recently read that mobileComposeMail will show the standard Share dialog and it does work. Users can then choose the location to place the file. The command isn't only for email, it seems to work for anything.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”