- Home /
Question by
Gameart1235 · Nov 02, 2014 at 02:10 AM ·
textureimagescreenshot
CaptureScreenshot to Texture
So I been working on something, and the thing I want is something that let the player can take a screenshot and then show that screenshot on to plane.
Can anyone tell me what I'm doing wrong.
I know this take the screenshot
Application.CaptureScreenshot("Screenshot.png");
I'm not really sure how to get this next part to work.
Application.persistentDataPath
I think you can use something like this to put the textures onto the plane, But not really sure.
tex.ReadPixels(new Rect(0,0,128,128),0,0);
tex.Apply();
display.material.mainTexture = tex;
Plz help.
Comment
Answer by Nebukam · Nov 02, 2014 at 03:32 AM
Since CaptureScreenshot saves a .png file under Application.persistentDataPath you then need to load the png file to be able to use it as a Texture2D and finally set it as you material texture. Check http://docs.unity3d.com/ScriptReference/WWW.LoadImageIntoTexture.html for more info & example on the procedure :)