export snapshot.

The place to discuss anything and everything about running your LiveCode on Android

Moderators: heatherlaine, Klaus, FourthWorld, robinmiller, kevinmiller

Post Reply
Googie85
Posts: 98
Joined: Tue Aug 05, 2014 10:07 am

export snapshot.

Post by Googie85 » Wed Jul 18, 2018 11:51 am

Hi Guys!

I am trying to store a screenshot on my Android device.

Code: Select all

   export snapshot from card "Main" at size 1536,2048 to file "test.png" as PNG    
when the line of code is executed me device "stops".

Am I doing it wrong?

Many Thanks,


Googie.

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

Re: export snapshot.

Post by Klaus » Wed Jul 18, 2018 12:01 pm

Hi Googie,

if you do not provide an absolute pathname, the engine presumes "the defaultfolder",
which is the folder containing the engine and that is NOT writable, so your script
generates an error and stops!

Do this:

Code: Select all

...
## The only folder on mobile where we have definitvely write permissions:
put specialfolderpath("documents") & "/test.png" into tFile
export snapshot from card "Main" at size 1536,2048 to file tFile as PNG    
...
Best

Klaus

Googie85
Posts: 98
Joined: Tue Aug 05, 2014 10:07 am

Re: export snapshot.

Post by Googie85 » Wed Jul 18, 2018 12:04 pm

Thanks for your reply Klaus!

I am trying to store the screenshot into a folder on the device...

Greatfully Appreciate Your Help!!!

Many Thanks,

Googie.

Post Reply

Return to “Android Deployment”