Contents

CGDisplayCapture(_:)

Obtains exclusive use of a display, preventing other applications and system services from using the display or changing its configuration.

Declaration

func CGDisplayCapture(_ display: CGDirectDisplayID) -> CGError

Parameters

  • display:

    The identifier of the display to capture.

Return Value

A Core Graphics result code. To interpret the result code, see CGError.

Discussion

When an application captures a display, Quartz doesn’t allow other applications and system services to use the display or change its configuration.

If hardware or software mirroring is in effect, the easiest way to capture the primary display and all mirrored displays is to use the function CGCaptureAllDisplays(). In case of software mirroring, applications that draw directly to the display must make sure to draw the same content to all displays in the mirror set.

See Also

Functions