-1

In iOS, I want to know at runtime, how many pixels a point has.

jokeman
  • 1,277
  • 9
  • 22

1 Answers1

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:

  1. detect an iphone 5 (*)
  2. your app knows iphone6 means a ~1.9632inch display width (***)
  3. you calculate 1.963 * 163 = ~ 320 points in width
  4. you detect the resolution pixels in width 640 (**)
  5. 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

Community
  • 1
  • 1
mindcatch
  • 21
  • 3