Core Graphics Functions

No overview available.

Topics

Functions

CGAcquireDisplayFadeReservation

Reserves the fade hardware for a specified time interval.

CGAssociateMouseAndMouseCursorPosition

Connects or disconnects the mouse and cursor while an application is in the foreground.

CGBeginDisplayConfiguration

Begins a new set of display configuration changes.

CGCancelDisplayConfiguration

Cancels a set of display configuration changes.

CGCaptureAllDisplays

Captures all attached displays.

CGCaptureAllDisplaysWithOptions

Captures all attached displays, using the specified options.

CGColorConversionInfoCreateFromList

Creates a conversion between an arbitrary number of specified color spaces.

CGCompleteDisplayConfiguration

Completes a set of display configuration changes.

CGConfigureDisplayFadeEffect

Modifies the settings of the built-in fade effect that occurs during a display configuration.

CGConfigureDisplayMirrorOfDisplay

Changes the configuration of a mirroring set.

CGConfigureDisplayMode

Configures the display mode of a display.

Deprecated
CGConfigureDisplayOrigin

Configures the origin of a display in the global display coordinate space.

CGConfigureDisplayStereoOperation

Enables or disables stereo operation for a display, as part of a display configuration.

CGConfigureDisplayWithDisplayMode

Configures the display mode of a display.

CGCursorIsDrawnInFramebuffer

Returns a Boolean value indicating whether the mouse cursor is drawn in framebuffer memory.

Deprecated
CGCursorIsVisible

Returns a Boolean value indicating whether the mouse cursor is visible.

Deprecated
CGDirectDisplayCopyCurrentMetalDevice

Returns a reference to the Metal device currently driving a given display.

CGDisplayAvailableModes

Returns information about the currently available display modes.

Deprecated
CGDisplayBestModeForParameters

Returns information about the display mode closest to a specified depth and screen size.

Deprecated
CGDisplayBestModeForParametersAndRefreshRate

Returns information about the display mode closest to a specified depth, screen size, and refresh rate.

Deprecated
CGDisplayBounds

Returns the bounds of a display in the global display coordinate space.

CGDisplayCapture

Captures a display for exclusive use by an application.

CGDisplayCaptureWithOptions

Captures a display for exclusive use by an application, using the specified options.

CGDisplayCopyAllDisplayModes

Returns information about the currently available display modes.

CGDisplayCopyColorSpace

Returns the color space for a display.

CGDisplayCopyDisplayMode

Returns information about a display’s current configuration.

CGDisplayCreateImage

Returns an image containing the contents of the specified display.

CGDisplayCreateImageForRect

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

CGDisplayCurrentMode

Returns information about the current display mode.

Deprecated
CGDisplayFade

Performs a single fade operation.

CGDisplayFadeOperationInProgress

Returns a Boolean value indicating whether a fade operation is currently in progress.

Deprecated
CGDisplayGammaTableCapacity

Returns the capacity, or number of entries, in the gamma table for a display.

CGDisplayGetDrawingContext

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

CGDisplayHideCursor

Hides the mouse cursor, and increments the hide cursor count.

CGDisplayIDToOpenGLDisplayMask

Maps a display ID to an OpenGL display mask.

CGDisplayIOServicePort

Returns the I/O Kit service port of the specified display.

Deprecated
CGDisplayIsActive

Returns a Boolean value indicating whether a display is active.

CGDisplayIsAlwaysInMirrorSet

Returns a Boolean value indicating whether a display is always in a mirroring set.

CGDisplayIsAsleep

Returns a Boolean value indicating whether a display is sleeping (and is therefore not drawable).

CGDisplayIsBuiltin

Returns a Boolean value indicating whether a display is built-in, such as the internal display in portable systems.

CGDisplayIsCaptured

Returns a Boolean value indicating whether a display is captured.

Deprecated
CGDisplayIsInHWMirrorSet

Returns a Boolean value indicating whether a display is in a hardware mirroring set.

CGDisplayIsInMirrorSet

Returns a Boolean value indicating whether a display is in a mirroring set.

CGDisplayIsMain

Returns a Boolean value indicating whether a display is the main display.

CGDisplayIsOnline

Returns a Boolean value indicating whether a display is connected or online.

CGDisplayIsStereo

Returns a Boolean value indicating whether a display is running in a stereo graphics mode.

CGDisplayMirrorsDisplay

For a secondary display in a mirroring set, returns the primary display.

CGDisplayModeCopyPixelEncoding

Returns the pixel encoding of the specified display mode.

Deprecated
CGDisplayModeGetHeight

Returns the height of the specified display mode.

CGDisplayModeGetIODisplayModeID

Returns the I/O Kit display mode ID of the specified display mode.

CGDisplayModeGetIOFlags

Returns the I/O Kit flags of the specified display mode.

CGDisplayModeGetRefreshRate

Returns the refresh rate of the specified display mode.

CGDisplayModeGetTypeID

Returns the type identifier of Quartz display modes.

CGDisplayModeGetWidth

Returns the width of the specified display mode.

CGDisplayModeIsUsableForDesktopGUI

Returns a Boolean value indicating whether the specified display mode is usable for a desktop graphical user interface.

CGDisplayModeRelease

Releases a Core Graphics display mode.

CGDisplayModeRetain

Retains a Core Graphics display mode.

CGDisplayModelNumber

Returns the model number of a display monitor.

CGDisplayMoveCursorToPoint

Moves the mouse cursor to a specified point relative to the display origin (the upper-left corner of the display).

CGDisplayPixelsHigh

Returns the display height in pixel units.

CGDisplayPixelsWide

Returns the display width in pixel units.

CGDisplayPrimaryDisplay

Returns the primary display in a hardware mirroring set.

CGDisplayRegisterReconfigurationCallback

Registers a callback function to be invoked whenever a local display is reconfigured.

CGDisplayRelease

Releases a captured display.

CGDisplayRemoveReconfigurationCallback

Removes the registration of a callback function that’s invoked whenever a local display is reconfigured.

CGDisplayRestoreColorSyncSettings

Restores the gamma tables to the values in the user’s ColorSync display profile.

CGDisplayRotation

Returns the rotation angle of a display in degrees.

CGDisplayScreenSize

Returns the width and height of a display in millimeters.

CGDisplaySerialNumber

Returns the serial number of a display monitor.

CGDisplaySetDisplayMode

Switches a display to a different mode.

CGDisplaySetStereoOperation

Immediately enables or disables stereo operation for a display.

CGDisplayShowCursor

Decrements the hide cursor count, and shows the mouse cursor if the count is 0.

CGDisplayStreamCreate

Creates a new display stream to be used with a CFRunloop.

CGDisplayStreamCreateWithDispatchQueue

Creates a new display stream whose updates are delivered to a dispatch queue.

CGDisplayStreamGetRunLoopSource

Gets the run loop source for a display stream.

CGDisplayStreamStart

Tells a stream to start sending updates.

CGDisplayStreamStop

Tells a stream to stop sending updates.

CGDisplayStreamUpdateCreateMergedUpdate

Combines two updates into a new update that includes the metadata for both source updates.

CGDisplayStreamUpdateGetDropCount

Returns the number of frames that have been dropped since the last call to your update handler.

CGDisplayStreamUpdateGetMovedRectsDelta

Return the movement delta values for a single update.

CGDisplayStreamUpdateGetRects

Returns an array of rectangles that describe where the frame has changed since the previous frame.

CGDisplayStreamUpdateGetTypeID

Returns the type identifier of a Quartz display stream update.

CGDisplaySwitchToMode

Switches a display to a different mode.

Deprecated
CGDisplayUnitNumber

Returns the logical unit number of a display.

CGDisplayUsesOpenGLAcceleration

Returns a Boolean value indicating whether Quartz is using OpenGL-based window acceleration (Quartz Extreme) to render in a display.

CGDisplayVendorNumber

Returns the vendor number of the specified display’s monitor.

CGEnableEventStateCombining

Enables or disables the merging of actual key and mouse state with the application-specified state in a synthetic event.

Deprecated
CGEventCreate

Returns a new Quartz event.

CGEventCreateCopy

Returns a copy of an existing Quartz event.

CGEventCreateData

Returns a flattened data representation of a Quartz event.

CGEventCreateFromData

Returns a Quartz event created from a flattened data representation of the event.

CGEventCreateKeyboardEvent

Returns a new Quartz keyboard event.

CGEventCreateMouseEvent

Returns a new Quartz mouse event.

CGEventCreateScrollWheelEvent

Returns a new Quartz scrolling event.

CGEventCreateSourceFromEvent

Returns a Quartz event source created from an existing Quartz event.

CGEventGetDoubleValueField

Returns the floating-point value of a field in a Quartz event.

CGEventGetFlags

Returns the event flags of a Quartz event.

CGEventGetIntegerValueField

Returns the integer value of a field in a Quartz event.

CGEventGetLocation

Returns the location of a Quartz mouse event.

CGEventGetTimestamp

Returns the timestamp of a Quartz event.

CGEventGetType

Returns the event type of a Quartz event (left mouse down, for example).

CGEventGetTypeID

Returns the type identifier for the opaque type CGEventRef.

CGEventGetUnflippedLocation

Returns the location of a Quartz mouse event.

CGEventKeyboardGetUnicodeString

Returns the Unicode string associated with a Quartz keyboard event.

CGEventKeyboardSetUnicodeString

Sets the Unicode string associated with a Quartz keyboard event.

CGEventPost

Posts a Quartz event into the event stream at a specified location.

CGEventPostToPSN

Posts a Quartz event into the event stream for a specific application.

CGEventSetDoubleValueField

Sets the floating-point value of a field in a Quartz event.

CGEventSetFlags

Sets the event flags of a Quartz event.

CGEventSetIntegerValueField

Sets the integer value of a field in a Quartz event.

CGEventSetLocation

Sets the location of a Quartz mouse event.

CGEventSetSource

Sets the event source of a Quartz event.

CGEventSetTimestamp

Sets the timestamp of a Quartz event.

CGEventSetType

Sets the event type of a Quartz event (left mouse down, for example).

CGEventSourceButtonState

Returns a Boolean value indicating the current button state of a Quartz event source.

CGEventSourceCounterForEventType

Returns a count of events of a given type seen since the window server started.

CGEventSourceCreate

Returns a Quartz event source created with a specified source state.

CGEventSourceFlagsState

Returns the current flags of a Quartz event source.

CGEventSourceGetKeyboardType

Returns the keyboard type to be used with a Quartz event source.

CGEventSourceGetLocalEventsFilterDuringSuppressionState

Returns the mask that indicates which classes of local hardware events are enabled during event suppression.

CGEventSourceGetPixelsPerLine

Gets the scale of pixels per line in a scrolling event source.

CGEventSourceGetSourceStateID

Returns the source state associated with a Quartz event source.

CGEventSourceGetTypeID

Returns the type identifier for the opaque type CGEventSourceRef.

CGEventSourceGetUserData

Returns the 64-bit user-specified data for a Quartz event source.

CGEventSourceKeyState

Returns a Boolean value indicating the current keyboard state of a Quartz event source.

CGEventSourceSecondsSinceLastEventType

Returns the elapsed time since the last event for a Quartz event source.

CGEventSourceSetKeyboardType

Sets the keyboard type to be used with a Quartz event source.

CGEventSourceSetLocalEventsFilterDuringSuppressionState

Sets the mask that indicates which classes of local hardware events are enabled during event suppression.

CGEventSourceSetLocalEventsSuppressionInterval

Sets the interval that local hardware events may be suppressed following the posting of a Quartz event.

CGEventSourceSetPixelsPerLine

Sets the scale of pixels per line in a scrolling event source.

CGEventSourceSetUserData

Sets the 64-bit user-specified data for a Quartz event source.

CGEventTapCreate

Creates an event tap.

CGEventTapCreateForPSN

Creates an event tap for a specified process.

CGEventTapEnable

Enables or disables an event tap.

CGEventTapIsEnabled

Returns a Boolean value indicating whether an event tap is enabled.

CGEventTapPostEvent

Posts a Quartz event from an event tap into the event stream.

CGGetActiveDisplayList

Provides a list of displays that are active (or drawable).

CGGetDisplayTransferByFormula

Gets the coefficients of the gamma transfer formula for a display.

CGGetDisplayTransferByTable

Gets the values in the RGB gamma tables for a display.

CGGetDisplaysWithOpenGLDisplayMask

Provides a list of displays that corresponds to the bits set in an OpenGL display mask.

CGGetDisplaysWithPoint

Provides a list of online displays with bounds that include the specified point.

CGGetDisplaysWithRect

Gets a list of online displays with bounds that intersect the specified rectangle.

CGGetEventTapList

Gets a list of currently installed event taps.

CGGetLastMouseDelta

Reports the change in mouse position since the last mouse movement event received by the application.

CGGetOnlineDisplayList

Provides a list of displays that are online (active, mirrored, or sleeping).

CGImageGetUTType

The Universal Type Identifier for the image.

CGInhibitLocalEvents

Turns off local hardware events in the current session.

Deprecated
CGMainDisplayID

Returns the display ID of the main display.

CGOpenGLDisplayMaskToDisplayID

Maps an OpenGL display mask to a display ID.

CGPointEqualToPoint

Returns whether two points are equal.

CGPostKeyboardEvent

Synthesizes a low-level keyboard event on the local machine.

Deprecated
CGPostMouseEvent

Synthesizes a low-level mouse-button event on the local machine.

Deprecated
CGPostScrollWheelEvent

Synthesizes a low-level scrolling event on the local machine.

Deprecated
CGRegisterScreenRefreshCallback

Registers a callback function to be invoked when local displays are refreshed or modified.

Deprecated
CGReleaseAllDisplays

Releases all captured displays.

CGReleaseDisplayFadeReservation

Releases a display fade reservation, and unfades the display if needed.

CGReleaseScreenRefreshRects

Deallocates a list of rectangles that represent changed areas on local displays.

Deprecated
CGRestorePermanentDisplayConfiguration

Restores the permanent display configuration settings for the current user.

CGScreenRegisterMoveCallback

Registers a callback function to be invoked when an area of the display is moved.

Deprecated
CGScreenUnregisterMoveCallback

Removes a previously registered callback function invoked when an area of the display is moved.

Deprecated
CGSessionCopyCurrentDictionary

Returns information about the caller’s window server session.

CGSetDisplayTransferByByteTable

Sets the byte values in the 8-bit RGB gamma tables for a display.

CGSetDisplayTransferByFormula

Sets the gamma function for a display by specifying the coefficients of the gamma transfer formula.

CGSetDisplayTransferByTable

Sets the color gamma function for a display by specifying the values in the RGB gamma tables.

CGSetLocalEventsFilterDuringSuppressionState

Filters local hardware events from the keyboard and mouse during the short interval after a synthetic event is posted.

Deprecated
CGSetLocalEventsSuppressionInterval

Sets the time interval in seconds that local hardware events are suppressed after posting a synthetic event.

Deprecated
CGShieldingWindowID

Returns the window ID of the shield window for a captured display.

CGShieldingWindowLevel

Returns the window level of the shield window for a captured display.

CGSizeEqualToSize

Returns whether two sizes are equal.

CGUnregisterScreenRefreshCallback

Removes a previously registered callback function invoked when local displays are refreshed or modified.

Deprecated
CGWaitForScreenRefreshRects

Waits for screen refresh operations.

Deprecated
CGWaitForScreenUpdateRects

Waits for screen update operations.

Deprecated
CGWarpMouseCursorPosition

Moves the mouse cursor without generating events.

CGWindowLevelForKey

Returns the window level that corresponds to one of the standard window types.

CGWindowListCopyWindowInfo

Generates and returns information about the selected windows in the current user session.

CGWindowListCreate

Returns the list of window IDs associated with the specified windows in the current user session.

CGWindowListCreateDescriptionFromArray

Generates and returns information about windows with the specified window IDs.

CGWindowListCreateImage

Returns a composite image based on a dynamically generated list of windows.

CGWindowListCreateImageFromArray

Returns a composite image of the specified windows.

CGWindowServerCFMachPort

Returns a Core Foundation Mach port (CFMachPort) that corresponds to the macOS window server.

Deprecated
CGColorConversionInfoCreate

Creates a conversion between two specified color spaces.

CGEventSourceGetLocalEventsSuppressionInterval

Returns the interval that local hardware events may be suppressed following the posting of a Quartz event.

CGDisplayStreamGetTypeID

Returns the type identifier of a Quartz display stream.

CGColorConversionInfoGetTypeID

Returns the Core Foundation type identifier for a color conversion info data type.