(IMPORTANT!)How to make a high resolution screenshot including GUI?

I wanna make a high resolution screenshot at 1000*1500 and Application.CaptureScreenshot with superSize(and anti aliasing turned off) didn`t work for me so now I use this script from http://saadkhawaja.com/take-hi-resolution-screenshot-transparent-background/ :

public int resWidth = 2550; 
   public int resHeight = 3300;
                
   private bool takeHiResShot = false;
                
       public static string ScreenShotName(int width, int height) {
       return string.Format("{0}/screen_{1}x{2}_{3}.png", 
                            Application.dataPath, 
                            width, height, 
                            System.DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss"));
   }
    
   public void TakeHiResShot() {
       takeHiResShot = true;
   }
    
   void LateUpdate() {
       takeHiResShot |= Input.GetKeyDown("k");
       if (takeHiResShot) 
       {
           RenderTexture rt = new RenderTexture(resWidth, resHeight, 24);
           camera.targetTexture = rt;
           Texture2D screenShot = new Texture2D(resWidth, resHeight, TextureFormat.ARGB32, false);
           camera.Render();
           RenderTexture.active = rt;
           screenShot.ReadPixels(new Rect(0, 0, resWidth, resHeight), 0, 0);
           camera.targetTexture = null;
           RenderTexture.active = null; 
           Destroy(rt);
           byte[] bytes = screenShot.EncodeToPNG();
           string filename = ScreenShotName(resWidth, resHeight);
 
           System.IO.File.WriteAllBytes(filename, bytes);
           Debug.Log(string.Format("Took screenshot to: {0}", filename));
           Application.OpenURL(filename);
           takeHiResShot = false;
       }
   }

It can make a screenshot at 1000*1500, but unfortunately the GUI is not included, so how can I make a high resolution screenshot including the GUI?

  1. Create a new camera that renders both the game and gui layers
  2. Attach your screenshot component to the camera
  3. Take Screenshot

This is a simple solution for your problem
If you need to take a screenshot of your game running, keep the camera disabled and only enabled it for the screenshot process.

Edit:
If you need to inglude OnGUI() on your screenshot

Try this: