CGGetDisplaysWithRect(_:_:_:_:)
Gets a list of online displays with bounds that intersect the specified rectangle.
Declaration
func CGGetDisplaysWithRect(_ rect: CGRect, _ maxDisplays: UInt32, _ displays: UnsafeMutablePointer<CGDirectDisplayID>?, _ matchingDisplayCount: UnsafeMutablePointer<UInt32>?) -> CGErrorParameters
- rect:
The location and size of a rectangle in the global display coordinate space. The origin is the upper-left corner of the main display.
- maxDisplays:
The size of the
displaysarray. This value determines the maximum number of displays that can be returned in thedisplaysparameter. Generally, you should specify a number greater than 0 for this parameter. If you specify 0, the value returned inmatchingDisplayCountis undefined and this function sets thedisplaysparameter toNULL. - displays:
A pointer to storage provided by the caller for an array of display IDs. On return, the array contains a list of displays whose bounds intersect the specified rectangle.
- matchingDisplayCount:
A pointer to a display count variable provided by the caller. On return, this variable contains the number of displays that were returned in the
displaysparameter. You must provide a non-NULLvalue for this parameter.
Return Value
A result code. See Core Graphics Data Types and Constants.
Discussion
If the dspys array is NULL, this function ignores the maxDisplays parameter. If the maxDisplays parameter is 0, this function ignores the displays array. In any case, this function fills in the matchingDisplayCount pointer with the number of displays that intersect the specified rectangle.
See Also
Functions
CGAcquireDisplayFadeReservation(_:_:)CGAssociateMouseAndMouseCursorPosition(_:)CGBeginDisplayConfiguration(_:)CGCancelDisplayConfiguration(_:)CGCaptureAllDisplays()CGCaptureAllDisplaysWithOptions(_:)CGCompleteDisplayConfiguration(_:_:)CGConfigureDisplayFadeEffect(_:_:_:_:_:_:)CGConfigureDisplayMirrorOfDisplay(_:_:_:)CGConfigureDisplayMode(_:_:_:)CGConfigureDisplayOrigin(_:_:_:_:)CGConfigureDisplayStereoOperation(_:_:_:_:)CGConfigureDisplayWithDisplayMode(_:_:_:_:)CGCursorIsDrawnInFramebuffer()CGCursorIsVisible()