Function

CGDisplayCreateImage(_:rect:)

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

Declaration

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

Parameters

display

The identifier of the display to be accessed.

rect

The rectangle, specified in display space, for the portion of the display being copied into the image.

Return Value

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

Discussion

The actual rectangle used is the rectangle returned by integral with rect as a parameter.

See Also

Creating Images from the Display

func CGDisplayCreateImage(CGDirectDisplayID) -> CGImage?

Returns an image containing the contents of the specified display.