I've made some tests on macOS 10.13 with dppx.
macOS has 4 scales:
1680 х 1050
1440 х 900 (as default begin 2016+)
1280 x 800 (as default untill 2016)
1024 х 640
I've cheched dppx (using this online service) and as a results, I've always got 2dppx!
Why? What am I doing wrong? This is a bug?
macbook resolution is 2560*1600, assuming that I have 2 dppx, real scaling is: 2560 / 2dppx x 1600 / 2 dppx === 1280 x 800
Other scalling is:
1680 х 1050 = 1.52 dppx
1440 х 900 = 1.77 dppx
1280 x 800 = 2 dppx
1024 х 640 = 2.5 dppx
I'm right? If so, why do the tools for checking dppx always write 2dppx?
This is consistent with how Mac OS treats retina as a whole. The scaling factor is locked at 2x and the virtual resolution of the screen changes, instead of the resolution of the screen being fixed and the scaling factor changing. The web browser is faithfully exposing this fact to the web page.
At 1680x1050, for instance, the entire screen is rendered at 3360x2100 with a 2x scaling factor, and then scaled down by a factor of 1.3125 to fit on the screen, but this scaling is invisible to apps. If the MacBook Retina is set to any resolution other than exactly 2x the physical display, then the user has no hope of seeing a pixel-perfect image.
For a platform where the devicePixelRatio can change, test your site against the display scaling in Android N, or change the zoom level in Chrome or Firefox, but not Safari.
Some links:
Understanding points and the user space in Cocoa Drawing as they interact with screen resolution
What resolution programmers will get in Macbook Pro Retina
https://www.anandtech.com/show/6023/the-nextgen-macbook-pro-with-retina-display-review/6
Related
I'm trying to design a responsive UI for my game.
I'd like that UI elements are scaled when screen resolution is below a certain threshold and repositioned otherwise.
Let's see it in an example.
I assume that the resolution of 1600 x 900 is the one below which UI elements must be scaled down keeping their aspect ratio.
In the following images, you can see the size that the red and the green panels should take at different resolutions (1600 x 900 in the former, 1280 x 720 in the latter).
On the contrary, when the screen resolution is greater than 1600 x 900 the panels should be simply reposed, without being scaled.
You can see an example, for a resolution of 1920 x 1080, in the following image.
I've been able to realize both logics, but not at the same time.
I've followed this article for repos logic (key point is to have a max size for panels) and Unity UI system tutorial for the scaling logic.
You could have 2 sets of prefab, one for each version and then swap them as needed depending on resolution.
This could be implemented by always having both canvases on the screen but only having the one shown that is supposed to be active in the current screen resolution.
I am using custom images for tab bar icons and they are showing up pixelated and I can't figure out why. The image is 32x32 and 300ppi. I've tried it on 72 and 150ppi and they are all pixelated. Anyone have a solution?
Thanks,
Adam
You need two images one 32 x 32 pixels and named MyIcon.png and one 64 x 64 pixels named MyIcon#2x.png. You then specify MyIcon in the storyboard and iOS will load the correct image for the current hardware.
The ppi (is a print production concept) has no effect in iOS. iOS measures every thing in Points, the iPhone 5 screen is 320 points x 568 points. Retina screens are 2 pixels x 2 pixels for each point. Non retina screens are 1 pixel = 1 point.
UPDATE:
For the iPhone 6 Plus (iOS 8) you now need a third image MyIcon#3x.png that is 96 x 96 see Image resolution for new iPhone 6 and 6+, #3x support added? for lots of good details.
I have to integrate an LCD screen to my embedded linux (ARM9) system. The LCD is portrait 320x480 and I need to run the screen in landscape orientation 480x320.
Using the LCD config register I can rotate it in hardware, so that (x,y)(0,0) is rotated 90 degrees.
Here starts my problem, the screen's wide side gets narrowed from 480 pixels to 320, and the long side of the picture is out of the screen. This should be fixed by changing the framebuffer dimensions AFAIK, but I tried a few ways to do it with no success yet.
using the fbset, below are the settings for portrait:
mode "480x320-55"
# D: 9.091 MHz, H: 18.182 kHz, V: 55.096 Hz
geometry 480 320 480 320 16
timings 110000 4 4 4 4 12 2
rgba 5/0,6/5,5/11,0/0
endmode
Sending the command:
fbset --geometry 480 320 480 320 16
Results in:
mode "480x320-55"
# D: 9.091 MHz, H: 18.182 kHz, V: 55.096 Hz
geometry 480 320 480 320 16
timings 110000 4 4 4 4 12 2
rgba 5/0,6/5,5/11,0/0
endmode
Which makes the picture appear a few times and overlaps, but the screen width is still too narrow.
I tried to provide double the screen size for the virtual xres and yres, but no change.
fbset --geometry 480 320 960 640 16
I also tried using fb rotate function I found on the web "saFbdevRotation.c", which uses the FB IOCTL, but the active screen size is still incorrect.
rotate 90 degrees, see output
$> ./fb_rotate -r 90
## Before rotation
### Fix Screen Info:
Line Length - 640
Physical Address = 81a00000
Buffer Length = 1048576
### Var Screen Info:
Xres - 320
Yres - 480
Xres Virtual - 320
Yres Virtual - 480
Bits Per Pixel - 16
Pixel Clk - 110000
Rotation - 0
## after rotation
### Fix Screen Info:
Line Length - 960
Physical Address = 81a00000
Buffer Length = 1048576
### Var Screen Info:
Xres - 480
Yres - 320
Xres Virtual - 480
Yres Virtual - 320
Bits Per Pixel - 16
Pixel Clk - 110000
Rotation - 90
I can also add that the system is very limited with free memory, can this cause the fb to NOT allocate a new buffer? However there were no errors in dmesg.
Will appreciate your advise.
I can also add that the system is very limited with free memory, can
this cause the fb to NOT allocate a new buffer? However there were no
errors in dmesg.
Normally,the standard way for allocating video buffer is to pre-allocate a large video buffer(based on the max video resolution you support) in the boot time,which pass a men= argument to the kernel so that kernel won't occupy it initially.
then later on,the video driver can do
void *ioremap(unsigned long phys_addr, unsigned long size)
which will create a mmap area for driver directly operate the frame buffer.
You can check it via doing cat /proc/iomen
Thus,the video driver memory is pre-allocated and is different from linux kernel system memory(like kmalloc() or get_free_pages() or vmalloc()), what you concerned is ruled out.
I think your issue is related to the LCD that you are using. I have seen several embedded LCDs that claim to support 90 deg rotation, but the result was exactly as you described.
My problems were always encountered using the RGB display interface. I suspect that the rotation might have worked using the CPU interface.
I have seen only one embedded display that was able to do the rotation correctly for RGB interface.
The thing is, you should try to do the rotation either with
LCD HW, your processor HW, or pure SW.
I do not know if Linux framebuffer might use pure SW or your processor HW, it probably depends on your driver.
Have you tried rotating the display by adding a line in config.txt (on the DOS boot partition)?
The line you would need is:
display_rotate=0..3
(where 0 is the default and 1 is 90 degrees clockwise, 2 180 degrees, etc.)
There's also an lcd_rotate command, but I'm not sure what the difference is.
I've developed some iPhone apps before, but I focus mostly on design. When designing in Photoshop, the dimensions are easy for the iPhone: 320x480 and 640x960. However, I'm trying to find documentation on dimensions for Mac AppStore. I'm not sure if there are any dimension requirements, since there are many different Mac screen sizes. What guidelines should I follow for designing? Any resources?
Unless there's a really good reason for your app to work at a single size, you should make it resizeable. You should make sure that it at least works well on a screen size as small as 1440x900, and making it fit on the 11" MacBook Air's 1366x768 screen shouldn't be too hard for most apps. If your app is likely to be used in a multitasking scenario, you should make sure that it works with less than half the width of the screen.
Apple's Human Interface Guidelines specify that Mac OS X supports screens with resolution as low as 800 x 600 pixels. It also says that the display could be rotated for a minimum of 600 x 800 instead. Their advice is to optimize your application for 1024 x 768 pixels, but be resizable for any situation possible.
Screen resolution has increased in iphone OS4. Since lot of UI stuff have hardcoded co-ordinates, will my app run properly on OS4? I still haven't got Snow Leopard, so cant test run the simulator for OS4.
It is publicly known that the number of points vs pixels is 2:1 so point 320 has 640 pixels in hi-res and 320 pixels in low-res. Low resolution images will be somewhat jaggy, but their positioning on the screen would remain the same.