- Home /
Preview of screenshot in unity
Hi , im saving the screen shot using Application.CaptureScreenshot() .After saving i throw two options share /retake.All these works fine but im not finding a way to show the screenshot preview to the user.
Once user clicks "capture" button , i'd like to show either the stored screenshot(from persistantdatapath) or just freeze the entire screen.Could you help me out in this?
Thank you Mukundan
Hi elixir.bash ,
i was looking for the same , did u had a chance to resolve the issue? infact it is for AR too
Hey centralvox ,could you please tel me what issue are yu facing ..
And don't post questions as answers. There are comments for that.
Answer by fherbst · May 14, 2012 at 08:18 AM
Instead of holding the game, you can load your screenshot into a texture and show it to the user. Use the WWW class. (Resource-wise, if thats critical in your application, you shouldn't use Application.CaptureScreenshot if you want to show the image afterwards, but use something like this where you already have the data and don't need to load it again).
IEnumerator TakeScreenshotAndLoadItIntoTexture(string filename) {
Application.CaptureScreenshot(filename);
WWW www = new WWW("file://" + filename);
while(!www.isDone)
yield return null;
myPreviewObject.renderer.material.mainTexture = www.texture;
}
This is exactly what i did man.. i made use of www and GUI.DrawTexture in my OnGui..
Answer by Paulius-Liekis · May 08, 2012 at 12:16 PM
Setting Time.timeScale to 0 should freeze your game (as long as you're using deltaTime properly).
Thanks for replying Paulius.. i'm not using deltaTime here.. This app im developing has a camera feed with some augmentation. will that information help me in getting a solution?