Contents

CGDisplayScreenSize(_:)

Returns the width and height of a display in millimeters.

Declaration

func CGDisplayScreenSize(_ display: CGDirectDisplayID) -> CGSize

Parameters

  • display:

    The identifier of the display to be accessed.

Return Value

The size of the specified display in millimeters, or 0 if the display is not valid.

Discussion

If Extended Display Identification Data (EDID) for the display device is not available, the size is estimated based on the device width and height in pixels from CGDisplayBounds(_:), with an assumed resolution of 2.835 pixels/mm or 72 dpi, a reasonable guess for displays predating EDID support.

See Also

Functions