What are pixels and points in iOS?

Viewed 58439

from UIImage reference:

@property(nonatomic, readonly) CGSize size

The dimensions of the image, taking orientation into account.

Discussion

In iOS 4.0 and later, this value reflects the logical size of the image and is measured in points. In iOS 3.x and earlier, this value always reflects the dimensions of the image measured in pixels.

What's the difference between pixels and points in iOS?

4 Answers

iOS pixels vs points vs units

We should review them in context of

  • coordinate systems
  • absolute and relative positioning

Differences

  • pixels(absolute absolute) - pixel-based coordinate systems of current screen. Is used in very specific cases. For example CGImage (The width/height, in pixels, of the required image), CGContext

  • points(virtual pixels, logical pixels)(absolute absolute) - default Point-based coordinate systems. It is a kind of density independent pixel - dp in Android.

  • units - unit coordinate systems(relative absolute). From 0.0 to 1.0. For example CALayer.anchorPoint

[iOS Frame vs Bounds]

Related