Instance Property

backingScaleFactor

The backing scale factor.

Declaration

var backingScaleFactor: CGFloat { get }

Discussion

The value of this property is 2.0 for high-resolution scaled display modes, and 1.0 for all other cases.

There are some scenarios where an application that is resolution-aware may want to reason on its own about the display environment it is running in.

It is important to note that the value of this property does not represent anything concrete, such as pixel density or physical size, because it can vary based on the configured display mode. For example, the display may be in a mirrored configuration that is still high-resolution scaled, resulting in pixel geometry that may not match the native resolution of the display device.

See Also

Converting Coordinates

func backingAlignedRect(NSRect, options: AlignmentOptions) -> NSRect

Returns a backing store pixel aligned rectangle in window coordinates.

func convertFromBacking(NSRect) -> NSRect

Converts a rect from its pixel aligned backing store coordinate system to the window’s coordinate system.

func convertToBacking(NSRect) -> NSRect

Converts a rectangle from the window’s coordinate system to its pixel aligned backing store coordinate system.

func convertToScreen(NSRect) -> NSRect

Converts the rectangle to the screen coordinate system from the window’s coordinate system.

func convertFromScreen(NSRect) -> NSRect

Converts the rectangle from the screen coordinate system to the window’s coordinate system