UIScreen's nativeBounds tells the wrong resolution for 4K TV - native

I have an Apple TV 4K (tvOS 11.1) connected to a 4K TV display and set Apple TV to 4K SDR 60Hz in Settings.
When I print [UIScreen mainScreen].nativeBounds, it prints out 1920x1080 instead of 3840x2160.
Does anyone know why ?

This is expected: bounds is reported in points, not pixels. When running on a 4K display, tvOS considers that display to be a "Retina" (2x) version of a 1080p display. So the bounds size will be the same, but the .scale of the screen will be 2.0 on 4K instead of 1.0 on 1080p.

Related

iTunes Connect Screenshot 5"5 format

to submit the new version of my application, i had to add screenshot in 5,5 inches, 4,7 inches and 12,9 inches.
according to the "iTunes Connect Developer Guide=> Screenshot properties" the following resolution are allowed to be upload on the appstore
Screenshot requirements are:
72 dpi, RGB, flattened, no transparency
High-quality JPEG or PNG image file format
Any of the following sizes:
640 x 920 pixels for hi-res portrait (without status bar) minimum
640 x 960 pixels for hi-res portrait (full screen) maximum
960 x 600 pixels for hi-res landscape (without status bar) minimum
960 x 640 pixels for hi-res landscape (full screen) maximum
But each time i want to upload a screenshot i got the following message:
Les dimensions d’une ou plusieurs captures d’écran sont incorrectes. En savoir plu
without any additional advice.
Is there any other restriction on the format file to be approved by itunesconnect??
My picture is 640x960 72dpi rgb in jpeg format.
I don't know what to do and how i can upload my screenshot to upgrade my app...
Thanks for your help
Welcome to StackOverflow! Looks like you are trying to upload the wrong sizes:
The following sizes are allowed/available in iTunes Connect:
From what you have written above, it looks like you wanted to upload 3.5-inch screenshots (640x960) for the 4.7-inch iPhone, but only 1334x750 or 750x1334 are allowed screenshot sizes for that category.
If you don't have a different behaviour on the 4.7-inch iPhone compared to the 5.5-inch version, I recommend using the Media manager and using the 5.5-inch screenshots for all other sizes.

Understanding points and the user space in Cocoa Drawing as they interact with screen resolution

Cocoa drawing sizes (widths & heights) are specified in points which are defined as follows in the OS X Cocoa Drawing Guide documentation:
"A single point is equivalent to 1/72 of an inch"
I understand from this that a point is a physical distance. So if my screen is 20 inches wide (for example) I would have 20 x 72 = 1440 points of horizontal width in points to work with. In other words, a point is independent of the resolution of the device.
This does not seem to be so...
A simple cocoa application using window width as a test shows that:
1) when my resolution is set to 1680x1050 it will take a width of 1680 points to span the width of the screen
2) similarly, if I change my resolution to 2560x1440 it will take a window width of 2560 points to span the width of the screen
Also confusing (in a contradictory way) is the statement made in the High Resolution Guidelines Apple Document that:
Each point in user space is backed by four pixels
The above tests seem to indicate that I have a user space of 1680x1050 when my display resolution is set to 1680x1050. If there are 4 pixels per user point then this would point to an effective "real" resolution of 2 times (1680x1050) = 3360x2100 which is more than the native resolution my 13 inch retina macbook pro of 2560x1600.
Points are an abstract, virtual coordinate system. The intent is that you usually design and write drawing code to work in points and that will be roughly consistent to human vision, compensating for different physical display pixel densities and the usual distance between the display and the user's eyes.
Points do not have a reliable relationship to either physical distance units (inches, centimeters, etc.) or physical display pixels.
For screen displays, there are at least three different measurements. For example, the screen of a Retina MacBook Pro has 2880x1800 physical pixels. In the default mode, that's mapped to 1440x900 points, so each point is a 2x2-pixel square. That's why a window on such a system has the same visual size as the same window on a non-Retina MacBook Pro with a screen with 1440x900 physical pixels mapped to 1440x900 points. The window is measured in points and so takes up the same portion of the screen real estate. However, on the Retina display, there are more pixels allowing for finer detail.
However, there is another layer of complexity possible. You can configure that Retina system to display more content on the screen at the cost of some of the detail. You can select a display mode of 1920x1200 points. In that mode, the rendering is done to a backbuffer of 3840x2400 pixels. That allows for rendering at a higher level of detail but keeps the math simple; points are still mapped to 2x2-pixel squares. (This simple math also avoids problems with seams when drawing abutting bitmap images.) But 3840x2400 is greater than the number of physical pixels in the display hardware. So, that backbuffer is scaled down when actually drawn on the screen to the physical 2880x1800 pixels. This loses some of the higher detail from the backbuffer, but the results are still finer-detailed than either a physical 1920x1200 screen or scaling up a 1920x1200 rendering to the physical 2880x1800 screen.
So, for this configuration:
Screen size in points: 1920x1200
Backbuffer in in-memory pixels: 3840x2400
Physical pixels in display hardware: 2880x1800
Other configurations are, of course, possible:
Screen size in points: 2880x1800
Backbuffer in pixels: 2880x1800
Physical pixels: 2880x1800
Everything will be teeny-tiny but you'll be able to fit a lot of stuff (e.g. many lines of text) on the screen.
Screen size in points: 1280x800
Backbuffer in pixels: 2560x1600
Physical pixels: 2880x1800
This will actually make everything (text, buttons, etc.) appear larger since there are fewer points mapped to the same physical pixels. Each point will be physically larger. Note, though, that each point still maps to a 2x2-pixel square in the backbuffer. As before, the backbuffer is scaled by the hardware to the physical display. This time it's scaled up slightly rather than down. (This scaling is the same thing as happens on a non-Retina LCD display when you select a mode with fewer pixels than the physical display. Obviously, an LCD can't change the number of physical pixels it has, so the different resolution is accomplished by scaling a backbuffer.)
Etc.

Multi image's resolution development with WP

I am a beginner in WP development with Monogame, and I want to develop a universal WP app (All devices which run under WP).
Can you give me the different screen's resolution and aspect ratio?
480 × 800, ratio 15:9, scale factor 1 — WVGA, the only one supported by WP7.x OS version
768 × 1280, ratio 15:9, scale factor 1.6 — WXGA
720 × 1280, ratio 16:9, scale factor 1.5 — 720p
1080 x 1920, ratio 16:9, scale factor 2.25 — 1080p
The resolution in “logical pixels” (after the scaling) is either 480×800 on 15:9 screens, or 480×853 on 16:9 screens.
Source.

How to adjust aspect ratio and resolution in tokbox

I've created a simple WebRTC chat app using tokbox / opentok 2.0.
However, I am having trouble figuring out how to make sure that the video appears in a 16.9 aspect ratio. The default on most systems is 4.3, and on my MacBook Pro, I am getting 16.9 squished into a 4.3 box.
Is there an api call I am missing to force a widescreen aspect ratio?
There is no way to change the aspect ratio on TokBox's API, although you can set the width and height properties when you call initPublisher or session.subscribe(). It says in the documentation:
If the width and height of the display do not match the 4:3 aspect ratio of the video signal, the video stream is cropped to fit the display.

equal video dimensions have same aspect ratio

I uploaded a test video on YouTube with a 2.39:1 aspect ratio and YouTube converted it into the following qualities: 240p, 360p 480p, 720p, 1080p.
I downloaded the 1080p video to check its dimensions and they were 1920 x 664, or an aspect ratio of 2.89:1.
Does that mean that "1080p videos" don't need to have a 16:9 aspect ratio?
Let's say I have two videos, both 1920x1080.
Does that mean that both videos have same aspect ratio of 16:9 ?
Does that mean videos qualified as 1080p need to have:
dimensions 1920x1080
aspect ratio 16:9
Wikipedia says "1080p is a set of HDTV high-definition video modes that are characterized by 1080 horizontal lines of vertical resolution and progressive scan. The term assumes a widescreen aspect ratio of 16:9, thus implying a resolution of 1920 × 1080 (2.1 megapixels)," although no credible source is cited.
YouTube/Google define their interpretation of 1080p in YouTube Player API Reference for Embeds: Playback quality:
Quality level hd1080: Player height is 1080px, and player dimensions
are 1920px by 1080px (for 16:9 aspect ratio) or 1440px by 1080px (for
4:3 aspect ratio).
I've never heard of a 2.89 aspect ratio. 16/9 = 1.7̅ 1920 x 664 is really strange. Maybe it's a bug in YouTube's converter. But I guess you could gain more control by uploading video which you've already converted to a standard aspect ratio yourself.