Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed Oct 04, 2015 at 12:25 PM by whaleinthesea for the following reason:

Other

avatar image
0
Question by whaleinthesea · Sep 14, 2015 at 02:47 PM · guisizefilescreenshotio

(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?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

  • Sort: 
avatar image
0

Answer by Jeffom · Sep 14, 2015 at 06:54 PM

  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: http://answers.unity3d.com/questions/31011/how-to-take-a-screenshot-that-includes-gui.html

Comment
Add comment · Show 5 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image whaleinthesea · Sep 14, 2015 at 07:04 PM 0
Share

Thanks, but how can I make a screenshot that is larger than my screen for example my screen is 320*480 and I want to make a screen shot that is 1000*1500 big??

avatar image Jeffom whaleinthesea · Sep 15, 2015 at 06:34 PM 0
Share

Do you want to take the screenshot of objects outside the screen? or do you simply want to increase the image resolution?

avatar image whaleinthesea · Sep 15, 2015 at 06:43 PM 0
Share

@Jeffrom I want to increase the image resolution (so I can print it for example) And also include the GUI

avatar image Jeffom whaleinthesea · Sep 16, 2015 at 01:00 PM 0
Share

@matyboy02 have you tried using this? http://docs.unity3d.com/ScriptReference/Screen.SetResolution.html

if you're using the editor you can try to change de window resolution in the window layout setting

avatar image whaleinthesea Jeffom · Sep 16, 2015 at 05:58 PM 0
Share

No, Screen.SetResolution don't work :( and if I set the resolution in the editor to 1000*1500 the editor says: Using resolution 356*534. How can I fix this?

Follow this Question

Answers Answers and Comments

30 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Changing start scene gui size main menu 0 Answers

Relate font size to screen size in GUISkin 2 Answers

how to reduce library size? 2 Answers

Edit FontSettings from script 0 Answers

GUILabel wrong text wrapping when font changed by style 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges