Question by
corrivai · Jul 05, 2016 at 03:59 PM ·
unity 5screenshotcapturescreenshotdpi
create a image at 200 dpi in unity
Hi, I want to capture an image with a resolution of 200 DPI. This is the code that I use:
RenderTexture rt = new RenderTexture((int)larghezza, (int)_Altezza, 24);
camTmp.targetTexture = rt;
Texture2D _Screen = new Texture2D((int)larghezza, (int)_Altezza, TextureFormat.ARGB32, true);
camTmp.Render();
RenderTexture.active = rt;
_Screen.ReadPixels(new Rect(0, 0, larghezza, (int)_Altezza), 0, 0);
_Screen.Apply();
//camera.targetTexture = null;
RenderTexture.active = null;
byte[] bytes = _Screen.EncodeToPNG();
string filename = Path + ".png";
System.IO.File.WriteAllBytes(filename, bytes);
How can I do? Thank you!
Comment
Your answer
Follow this Question
Related Questions
Ingame camera capture/display,Is there a way i can make a camera option... 0 Answers
ScreenCapture.CaptureScreenshotAsTexture() throws warnings 0 Answers
How to save screenshots to com.company.product folder? 1 Answer
gameview capture in realtime 1 Answer
Texture2D.ReadPixels doesn't capture image effects. 1 Answer