Returns a composite image based on a dynamically generated list of windows.
- macOS 10.5+
- Mac Catalyst 13.0+
- Core Graphics
The rectangle that you want to capture. The coordinates of the rectangle must be specified in screen coordinates, where the screen origin is in the upper-left corner of the main display and y-axis values increase downward. Specify
CGRectto indicate the minimum rectangle that encloses the specified windows. Specify
CGRectto capture the entire desktop area.
The options describing which windows to include in the image. Typical options let you choose all windows or windows above or below the window specified in the
windowparameter. For more information, see
Window List Option Constants.
The ID of the window to use as a reference point when determining which other windows to include in the image. For options that do not require a reference window, this parameter can be
CGNull Window ID
The options that determine which parts of the window to capture. If you specified
screenparameter, these options affect the resulting bounding box used for the image. For example, if you include a window’s screen effects in the image, the bounding box may need to be slightly larger to accommodate those effects. For a list of possible options, see
Window Image Types.
A composite image formed from the contents of the specified set of windows. If the windows are unreadable or no windows meet the specified criteria, this function returns an image that is either 0 by 0 pixels in size or is of the specified size but is filled with the transparent black color. If you call this function from outside of a GUI security session or when no window server is running, this function returns
Any windows that are onscreen but whose sharing setting is set to
k are skipped and not included in the resulting image. If this results in no windows being available in the selected range, this function returns