- Home /
capture a screen shot and show in the album folder
Hi... i don't know why i am having this issue .. but i have this script to capture the screen shot .. i applied it to a button ... the screen blink when i press the button but when i open the gallery of my tablet it doesn't show the captured screen shot ... :( .. when i test this code on PC or in unity editor it works fine.. it creates the folder at the folder "D:/Omer Hussain/Amigo-Projects/ChristmasStory/ScreenShots"; with the folder name "ScreenShots" and in that folder saves the image with image name "Christmas".... i want the same functionality on the device... i tried to find the folder as well the image with their names but device doesn't show anything but works fine on PC :/...
using UnityEngine;
using System.Collections;
public class ScreenShot : MonoBehaviour {
//string folderPath = "D:/Omer Hussain/Amigo-Projects/ChristmasStory/ScreenShots";
string folderPath = "/storage/sdcard0/ChristmasShots";
string fileName = "Christmas.png";
void OnMouseDown()
{
if(!System.IO.Directory.Exists(folderPath))
System.IO.Directory.CreateDirectory(folderPath);
Application.CaptureScreenshot(folderPath + "/"+fileName);
}
}
You try this one.This is a complete solution of capture screenshot http://u3d.as/content/devesh-pandey/capture-and-save/86U
Answer by FairGamesProductions · Nov 20, 2014 at 12:47 PM
This command would most likely save the screenshot in the game folder.
If you want to change the save location, you need to supply a full path for the file save location. Also, this command overrides the previously saved file if you run it twice with the same save file name.
@FairGamesProductions how do we do that ... and any other solution for not overriding the image and show it in the gallery :/
Your answer
Follow this Question
Related Questions
How to open Device camera in full view in unity 3d. 1 Answer
Screenshot function not working properly ,it records button on UI ? 0 Answers
Application crashes when taking screenshot on Android with API >28 0 Answers
how to open the android camera in unity without using Qualcomm'AR 0 Answers
Cant find where the screenshots are saved or if they are even taken 1 Answer