Function

CGLayerGetContext

Returns the graphics context associated with a layer object.

Declaration

CGContextRef CGLayerGetContext(CGLayerRef layer);

Parameters

layer

The layer whose graphics context you want to obtain.

Return Value

The graphics context associated with the layer.

Discussion

The context that’s returned is the context for the layer itself, not the context that you specified when you created the layer.

See Also

Getting Layer Information

CGLayerGetSize

Returns the width and height of a layer object.