- Home /
Question by
absameen · Aug 26, 2012 at 01:17 PM ·
screeneditorwindowreadpixels
ReadPixels from Game View (EditorWindow)
I'm trying to save the current game view into a texture with ReadPixels. This works when the game is running with:
Texture2D tex2d = new Texture2D(Screen.width,Screen.height,TextureFormat.RGB24,false);
tex2d.ReadPixels(new Rect(0,0,Screen.width,Screen.height),0,0,false);
tex2d.Apply();
However, it does not capture the game view when used from an EditorWindow. Pixels are read from the EditorWindow itself. How can we read pixels from the game view, when it is not running, using an editor script?
Edit: Application.CaptureScreenshot does a good job of capturing the game view from an EditorWindow into a file. How can we get similar results with ReadPixels?
Comment
Your answer
Follow this Question
Related Questions
ReadPixels problem 3 Answers
ReadPixels Screen is Offset 0 Answers
Trying to read pixel out of bounds - screenshot of just half the screen 1 Answer
Adjust GUI in all Screens?????? 1 Answer
Microsoft Surface Touch screen keyboard 2 Answers