I’m taking screenshot using Application.Capturescreenshot code and it’s taking the screenshot then storing to default location. But i want to store this screenshot into one specific folder and it should display in the gallery folder also. I used below code but the screenshot is not saving to SDCard and gallery.
if (GUI.Button(new Rect(Screen.width-85,Screen.height-(Screen.height-80),80,80), Zoom_Tex,camera_icon_style)) {
Screen_Shot_File_Name = model.name + System.DateTime.Now.ToString("__yyyy-MM-dd") + ".png";
Application.CaptureScreenshot(Screen_Shot_File_Name);
Shot_Taken = true;
//Debug.Log("path save is "+Screen_Shot_File_Name);
}
if(Shot_Taken == true)
{
string Origin_Path = System.IO.Path.Combine(Application.persistentDataPath, Screen_Shot_File_Name);
Debug.Log("Origin_Path save is "+Origin_Path);
// This is the path of my folder.
string Path = "/mnt/sdcard/DCIM/Inde/" + Screen_Shot_File_Name;
Debug.Log("Path save is "+Path);
if(System.IO.File.Exists(Origin_Path))
{
System.IO.File.Move(Origin_Path, Path);
Debug.Log("Path_move save is "+Path);
Shot_Taken = false;
}
}
Are you have a check this options Edit->Project Settings->Player->OtherSettings->WriteAccess->External Sd Card? And, if I'm not mistakes, CaptureScreenshot() save file into mnt/sdcard/android/data/"x.x.x"/files/name.png
– zharik86yes..I've choosen External Sd Card
– raj231yes...the CaptureScreenshot() saving to mnt/sdcard/android/data/"x.x.x"/files/name.png...But i want to save specific folder
– raj231I've tried your code but it's not working ever the screenshot is not saving to this path also mnt/sdcard/android/data/"x.x.x"/files/name.png
– raj231Try change little path, because Application.persistentDataPath get "/data/data/com.mycompany.myapp/files". Use path as "/sdcard/DCIM/Inde". But remember, if your device have 2 or more card memory, than path is "/sdcard0/DCIM/Inde".
– zharik86