CGDisplayBestModeForParametersAndRefreshRate(_:_:_:_:_:_:)
Returns information about the display mode closest to a specified depth, screen size, and refresh rate.
Declaration
func CGDisplayBestModeForParametersAndRefreshRate(_ display: CGDirectDisplayID, _ bitsPerPixel: Int, _ width: Int, _ height: Int, _ refreshRate: CGRefreshRate, _ exactMatch: UnsafeMutablePointer<boolean_t>?) -> CFDictionary?Parameters
- display:
The identifier of the display to be accessed.
- bitsPerPixel:
Optimal display depth, in bits per pixel. Note that this value is not the same as pixel depth, which is the number of bits per channel or component.
- width:
Optimal display width, in pixel units.
- height:
Optimal display height, in pixel units.
- refreshRate:
Optimal display refresh rate, in frames per second.
- exactMatch:
A pointer to a Boolean variable. On return, its value is
trueif an exact match in display depth, width, height, and refresh rate is found; otherwise,false. If this information is not needed, passNULL.
Return Value
A display mode dictionary, or NULL if the display is invalid. The dictionary is owned by the system and you should not release it. The dictionary contains information about the display mode closest to the specified depth, screen size, and refresh rate. For a list of the properties in a display mode dictionary, see Display Mode Standard Properties and Display Mode Optional Properties. For general information about using dictionaries, see CFDictionary.
Discussion
This function searches the list of available display modes for a mode that comes closest to satisfying these criteria:
Has a pixel depth equal to or greater than the specified depth
Has dimensions equal to or greater than the specified height and width
Uses a refresh rate equal to or near the specified rate
If a suitable display mode is not found, this function simply returns the current display mode.
Special Considerations
This deprecated function selects a display mode closest to the specified parameters. Starting in OS X v10.6 new display mode APIs should be used to query display modes so that an app can tailor its definition of “best” to its graphics and memory needs.
See Also
Functions
CGAcquireDisplayFadeReservation(_:_:)CGAssociateMouseAndMouseCursorPosition(_:)CGBeginDisplayConfiguration(_:)CGCancelDisplayConfiguration(_:)CGCaptureAllDisplays()CGCaptureAllDisplaysWithOptions(_:)CGCompleteDisplayConfiguration(_:_:)CGConfigureDisplayFadeEffect(_:_:_:_:_:_:)CGConfigureDisplayMirrorOfDisplay(_:_:_:)CGConfigureDisplayMode(_:_:_:)CGConfigureDisplayOrigin(_:_:_:_:)CGConfigureDisplayStereoOperation(_:_:_:_:)CGConfigureDisplayWithDisplayMode(_:_:_:_:)CGCursorIsDrawnInFramebuffer()CGCursorIsVisible()