Instance Property

scale

The scale factor of the image.

Declaration

var scale: CGFloat { get }

Discussion

If you load an image from a file whose name includes the @2x modifier, the scale is set to 2.0. You can also specify an explicit scale factor when initializing an image from a Core Graphics image. All other images are assumed to have a scale factor of 1.0.

If you multiply the logical size of the image (stored in the size property) by the value in this property, you get the dimensions of the image in pixels.

See Also

Getting the Image Size and Scale

var size: CGSize

The logical dimensions of the image, measured in points.