Function

CGDisplayCreateImage(_:)

Returns an image containing the contents of the specified display.

Declaration

func CGDisplayCreateImage(_ displayID: CGDirectDisplayID) -> CGImage?

Parameters

display

The identifier of the display for which an image is being created.

Return Value

An image containing the contents of the specified display. If the display ID is invalid, the return value is NULL. The caller is responsible for releasing the image created by calling CGImageRelease.

See Also

Creating Images from the Display

func CGDisplayCreateImage(CGDirectDisplayID, rect: CGRect) -> CGImage?

Returns an image containing the contents of a portion of the specified display.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software