07-16-2020 10:22 AM
Solved! Go to Solution.
07-16-2020 12:30 PM
RenderTexture rt = new RenderTexture(RES_WIDTH, RES_HEIGHT, 24);
RenderTextureCamera.targetTexture = rt;
Texture2D screenShot = new Texture2D(RES_WIDTH, RES_HEIGHT, TextureFormat.RGB24, false);
RenderTextureCamera.Render();
RenderTexture.active = rt;
screenShot.ReadPixels(new Rect(0, 0, RES_WIDTH, RES_HEIGHT), 0, 0);
screenShot.Apply();
Then to save itbyte[] bytes = screenShot.EncodeToJPG();
System.IO.File.WriteAllBytes(filename, bytes));
07-16-2020 12:30 PM
RenderTexture rt = new RenderTexture(RES_WIDTH, RES_HEIGHT, 24);
RenderTextureCamera.targetTexture = rt;
Texture2D screenShot = new Texture2D(RES_WIDTH, RES_HEIGHT, TextureFormat.RGB24, false);
RenderTextureCamera.Render();
RenderTexture.active = rt;
screenShot.ReadPixels(new Rect(0, 0, RES_WIDTH, RES_HEIGHT), 0, 0);
screenShot.Apply();
Then to save itbyte[] bytes = screenShot.EncodeToJPG();
System.IO.File.WriteAllBytes(filename, bytes));
07-16-2020 01:11 PM
07-16-2020 02:07 PM
07-16-2020 02:12 PM
07-16-2020 02:19 PM