I have a challenge that I’m pretty stuck with, and would appreciate some assistance.
I need an app to take a screenshot, and shortly after, show that screenshot to the user.
I made this work in a OS X project, where I simply dumped the screenshot in the hd root, and then loaded it with www (file://screenshot.png)
This worked quite well.
But I need it to work for iOS and android, and here it becomes tricky.
My current code looks like so :
Application.CaptureScreenshot("Screenshot.png");
StartCoroutine("GetScreenshot");
IEnumerator GetScreenshot () {
string path = Application.dataPath.Substring (0, Application.dataPath.Length - 5);
// Strip application name
path = path.Substring(0, path.LastIndexOf('/'));
path = "file://" + path + "/Documents/Screenshot.png";
WWW www = new WWW(path);// previously "file://Screenshot.png"
print(path);
yield return www;
recentScreenshot = new Texture2D(1, 1);
www.LoadImageIntoTexture(recentScreenshot);
mLobbyDisplay = true;
screen = "picture";
}