The captured screenshot is stored under Application.temporaryCachePath in Tizen.
You can copy it to the other path where you want.
This is a sample code to save the captured file under ‘Downloads’ folder.
(You should enable MediaStorage in PlayerSettings->Capabilities to copy a file to Downloads folder.)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.IO;
public class ScreenCapture : MonoBehaviour {
public void CaptureIt()
{
Application.CaptureScreenshot("MyCapture.png");
System.IO.File.Copy(Path.Combine(Application.temporaryCachePath, "MyCapture.png"), "/opt/usr/media/Downloads/MyTest.png", true);
}
}
hi after i try thats code, actually thats work for capture the game, but the result capture is just go to “/opt/usr/media/Downloads/MyTest.png” but i cant see the image on gallery… and after i restart my phone the capture image is available on gallery… but if i open my game and doing screencapture again the last capture is doesnt see on gallery and i must restart my phone to do that… have you try? thankyou…
@sukwon-suh i use this to call but still get error if i try to build the project “The type or namespace name `DllImport’ could not be found. Are you missing an assembly reference?”
public class NewBehaviourScript : MonoBehaviour {
#if !UNITY_EDITOR && UNITY_TIZEN
[DllImport ("updatecontent")]
private static extern bool tizenupdatecontent(string img_path);
#endif
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if (Input.GetKey(KeyCode.Menu))
{
Application.CaptureScreenshot("MyCapture.png");
#if !UNITY_EDITOR && UNITY_TIZEN
System.IO.File.Copy(Path.Combine(Application.temporaryCachePath, "MyCapture.png"), "/opt/usr/media/DCIM/MyTest.png", true);
tizenupdatecontent("/opt/usr/media/DCIM/MyTest.png");
#endif
}
}
}
yes @sukwon-suh , i try to build and run but error “The type or namespace name `DllImport’ could not be found. Are you missing an assembly reference?”
where the place you copied the libupdatecontent.so ? is on just at “assets” or “assets/plugins/tizen/libs” ? and is you are using [DllImport (“updatecontent”)] or [DllImport (“libupdatecontent”)] ?
thankyou so much @sukwon-suh the plugin is work without error, but the screenshot is still doesn’t available if we need to see on gallery… the screenshot is available on “/opt/usr/media/DCIM” folder but at gallery it doesn’t… i use Tizen Z1 and Z2 to test this. the screenshot will available on gallery if i restart my phone…
ya… i forgot the namespace, but after i use the namespace and test it again, it still doesn’t see the screenshot on gallery, but this just work if i find at folder… i will make the video how its looks like