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
0
Question by thiagoeo · Sep 24, 2014 at 11:16 PM · resolutionscreenshotscreen size

Correct resolution/screen size for an A4 piece of paper

I posted this question some time ago: http://answers.unity3d.com/questions/775149/is-it-possible-to-generate-a-printable-image.html asking if it was possible to generate an image to print, and I learned about Application.CaptureScreenshot(). I tested it and it served my purposes perfectly.

Now I'd like to ask about formating the image. I would like to make it so when I take the screenshot, it fits perfectly in an A4 paper, for printing, but I don't know how to archieve this. Do I have to choose a certain resolution for the "game"? Should I use an ortographic camera? I read here: http://superuser.com/questions/480194/what-is-standard-a4-paper-size-in-pixels-for-a-given-resolution that the standard size of the paper is 210mm × 297mm (8.27in × 11.69in), and that doing some calculations I don't understand, he arrived at the value 4960 x 7016 pixels. The problem is, I don't know what to do with this value. I tried setting this as the resolution of the "game" (not allwing the user to change it) but it doesn't seem to be right.

thanks in advance for any help.

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 Cherno · Sep 24, 2014 at 11:43 PM 0
Share

If you have bitmap image file that needs to be printed, you will have to decide at which resolution. DPI (Dots Per Inch) is often 300 for high-quality PDF documents, for example. So, taking a screenshot is only one half of what's needed.

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by LSPressWorks · Sep 25, 2014 at 04:29 AM

about halfway down they start getting to the good stuff.

http://forums.codeguru.com/showthread.php?85420-Converting-Pixels-to-Centimetres-and-inches

Comment
Add comment · 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
0

Answer by Max_Bol · Apr 07, 2016 at 02:53 AM

I'll give you a couple of tips about how you can manage this :

1) If you wish to produce documents for high-quality prints, you will need to use at least :

 public static void CaptureScreenshot(string XXXXX, int superSize = 4);

XXXXX is meant for the file path and file name.

This will produce a file that can be printed at between 288 DPI and above 480 DPI depending on your screen resolution. I specify the difference because the screenshot taken is based on the data rendered through your device graphics' bandwidth. Some screen and devices display at an equivalent of 72 DPI while others do it at 92 DPI (like Smartphones). Recent iPhone render at above 120 DPI which (which allow crystal clear buttons and layouts).

2) On the other side, it doesn't mean that all device will be able to render such screenshot. Remember that some devices don't have enough temporary memory bandwidth to store as much as 4x the fullscreen worth of RGB data that is required during the process. You might have to allow the user to force a lower resolution onto the application. For example, a big screenshot on a big high definition screen can take up to 256MB of memory bandwidth just to temporary store the screenshot without counting the actual requirement of the software itself. It's only for a short time, but it's a huge memory spike which can be hated by the user if his device become unresponsive for a 1 or 2 sec thinking the application crashed.

This is why I suggest you allow the user to select his preferred quality setting since you can give him/her such ability to do so just by storing a int value and returning it in CaptureScreenshot().

3) For the Format, it can be done, but it require a bit of voodoo magic. ;) You got to do it in multiple steps. First, you force the window into a specific resolution in window mode: http://docs.unity3d.com/ScriptReference/Screen.SetResolution.html

This resolution must be of the same ratio as the paper size you're aiming for. In case of the A4, the ratio is 1:1.414 (depending on the orientation you're aiming for, you might have to rotate the camera and UI by 90 degrees before taking the screenshot). You could force the window mode and specific resolution based on the actual user's screen resolution (so that the size of the application become as big as possible). You will have to store the original resolution and if the window mode was already active or not. Then, you make it so that Unity call the CaptureScreenShot();. After 1 or 2 sec, you do a check to confirm if the file is at the path (you have to store the path and file name in some variable to be able to compare). If the file is confirmed, the application can restore itself in the previously stored Window and Resolution.

If you wish to add more, you can even give the option to open the file path once the file is confirmed :

  FilePath = FilePath.Replace(@"/", @"\");   // explorer doesn't like front slashes
  System.Diagnostics.Process.Start("explorer.exe", "/select,"+FilePath );

Comment
Add comment · Show 3 · 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 Kamil1064 · Apr 07, 2016 at 08:35 AM 0
Share

@$$anonymous$$ax_Bol that's a lot of work, hopefully Renderator_PRO do all that stuff :) http://forum.unity3d.com/threads/released-renderator-v-1-01.381844/

avatar image Max_Bol Kamil1064 · Apr 12, 2016 at 02:23 AM 0
Share

@$$anonymous$$amil1064 Yeah, it's a lot of works. I'm still waiting for answer on the forum page of that asset link you wrote. Currently, many high-res screen takers don't support orthographic view or Screen Space Overlay UI element. They simply are ignored and this really doesn't help much.

avatar image Kamil1064 Max_Bol · Apr 12, 2016 at 09:59 AM 0
Share

Thanks @$$anonymous$$ax_Bol, already answered on thread: http://forum.unity3d.com/threads/released-renderator-v-1-01.381844/#post-2592558

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

How to make a grid fill the screen flexibly regardless of device size 0 Answers

Same size of a game object on every display 0 Answers

Change UI size dependent on screen resolution 1 Answer

Scale camera to fit screen size 1 Answer

How to set screen resolution 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