In iOS, I want to know at runtime, how many pixels a point has.
Asked
Active
Viewed 898 times
1 Answers
2
An iOS point is equivalent to 1/163 of an inch (160 android) and represents a visual perception entity for humans according to iphone 1 native resolution.
So a point here depends on pixel resolution AND physical display size.
You have to COMBINE a device detection() with the native pixel resolution detection() and hold a internal list of devices and their physical screen sizes in inch() because there is no function for that yet.
(*) + (**) already explained here:
iOS - How to get device make and model?
and here:
in iPhone App How to detect the screen resolution of the device
examples:
- detect an iphone 5 (*)
- your app knows iphone6 means a ~1.9632inch display width (***)
- you calculate 1.963 * 163 = ~ 320 points in width
- you detect the resolution pixels in width 640 (**)
- now you know the pixel:point ratio = 640/320 = 2
another in short.
detect iphone 6 means a ~2.54inch display width * 163 = ~414px and resolution of 1242 so pixel:point ratio = 1242/414 = 3