Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / Trying to take a screenshot to save it to the phone for other apps to use the image

Author
Message
Jonney
4
Years of Service
User Offline
Joined: 29th Nov 2014
Location:
Posted: 19th Jul 2015 21:21
I have been trying to get this to work all day today and I am really stuck. After many attempts this is what I have.
I am trying to take a screenshot of the game and then save the screenshot to the phone so that it can be accessed outside of the app with other apps later on. When a virtual button for screenshot is pressed it goes to the following:




I would be very grateful for any help anyone could offer.
=PRoF=
16
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 19th Jul 2015 23:47
AGK has a weirdly named "PrintImage" command, which saves an image to the gallery on Mobile devices.

In fact, I just checked the documentation for that command but it mentions nothing about saving images.

I'm sure it's the command that does it though :/

Jonney
4
Years of Service
User Offline
Joined: 29th Nov 2014
Location:
Posted: 20th Jul 2015 00:04
Hi PRoF,

I don't think that will do what I need. With 'PrintImage' you can only set the id and size and not the file name with that. It looks like its just for sending to a connected printer only. I need to save as a .png file

From the help files:

PrintImage
Description

Prints an image to a connected printer. This command is not guaranteed to work on all platforms. The size parameter determines how large the image is on the page, a value of 100 makes it use as much of the page as possible, 50 makes it use half this amount, 25 a quarter and so on.
Definition

PrintImage( image, size )
Parameters

image - the ID of the image to print
size - the amount of space to use on the page, between 0 and 100.
=PRoF=
16
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 20th Jul 2015 01:05
Yes, that's exactly what it does on mobiles, and unlike the "SaveImage" command, which only saves images into the private folder of your app (i.e. does not show up in the gallery), the "PrintImage" command DO show up in the gallery. It is true however that you don't get to specify the image name. From memory it saves them as sequentially numbered images.

=PRoF=
16
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 20th Jul 2015 01:09 Edited at: 20th Jul 2015 01:11
Excuse the double post, but I thought this all sounded familiar

http://forum.thegamecreators.com/?m=forum_view&t=209073&b=41

This is a link to my post, and the help I was given when I asked a similar question a while ago

Hope it helps

>Edit<
I'm also pretty sure that Paul has fixed the issue with images not showing up in the gallery straight away. I'm sure I read that in one of the update posts but can't find it right now.

Login to post a reply

Server time is: 2019-10-17 13:32:43
Your offset time is: 2019-10-17 13:32:43