Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
avatar image
1
Question by AliAzin · Feb 24, 2011 at 12:20 PM · screenshotcapture

Is it possible to take screenshots bigger than screen size?

Hi,

Is it possible to take screenshots bigger than screen size ?

Edited:

I wrote this script but when I change my size to something bigger than screen size it don't work. It seems unity wants to capture from screen itself not the renderTexture.

import System.IO;

var width : int = 2048; var height : int = 2048;

function Start() {

 var rt : RenderTexture = new RenderTexture(width,height,0);


 rt.width = width;
 rt.height = height;
 rt.format = RenderTextureFormat.ARGB32 ;

 camera.targetTexture = rt;
 camera.Render();

 print (rt.width);
 print (rt.height);

 var tex = new Texture2D (width, height, TextureFormat.ARGB32, false);
 tex.ReadPixels (Rect(0, 0, width, height), 0, 0);
 tex.Apply ();

 var bytes = tex.EncodeToPNG();
 Destroy (tex);

 File.WriteAllBytes(Application.dataPath + "/../SavedScreen.png", bytes);

 camera.targetTexture = null;


}

Comment
Add comment · Show 1
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 taoa · Feb 28, 2011 at 09:15 AM 1
Share

After you rendered your scene into your render texture via the camera, assign the render texture into the 'active' render texture, like so:

     RenderTexture oldRT = RenderTexture.active;
     RenderTexture.active = RT;

//... //Create texture, ReadPixels, write to file... //... RenderTexture.active = oldRT;

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by taoa · Feb 24, 2011 at 02:20 PM

Yes, and that's how I did it: http://answers.unity3d.com/questions/36875/how-to-save-a-render-texture-to-a-file

" I create a high-res render texture (x times the actual game window size) that I attach to a camera, and perform a camera.Render(), which draws the content of the scene into the render texture. "

I got help in how to save a render texture to a file (hence my question):

" You can use ReadPixels with a rendertexture "

That's all you need!

Comment
Add comment · Show 1 · 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 AliAzin · Feb 27, 2011 at 07:00 AM 0
Share

Thanks for your help. I tried that but I have a problem with writing it in file. I edited my post with my script. Any help would be appreciated.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

How to get a screenshot in game and re-use in game? 1 Answer

Screenshot is not save properly into the folder. 0 Answers

Does Application.CaptureScreenshot leak memory? (iOS) 0 Answers

Screen capture with System.Drawing not working 1 Answer

I need to take (save) a screenshot from a camera other than the main one. How would I do this? 0 Answers


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