Contents

CGDisplayGetDrawingContext(_:)

Returns a graphics context suitable for drawing to a captured display.

Declaration

func CGDisplayGetDrawingContext(_ display: CGDirectDisplayID) -> CGContext?

Parameters

  • display:

    The identifier of the display to be accessed.

Return Value

A Quartz graphics context suitable for drawing to a captured display, or NULL if the display has not been captured. The context is owned by the system and you should not release it.

Discussion

After capturing a display or changing the configuration of a captured display, you can use this function to obtain the current graphics context for the display. The graphics context remains valid while the display is captured and the display configuration is unchanged. Releasing the captured display or reconfiguring the display invalidates the context. To determine when the display configuration is changing, you can use the function CGDisplayRegisterReconfigurationCallback(_:_:) to register a display reconfiguration callback.

See Also

Functions