Sets the pattern phase of a context.
SDKs
- iOS 2.0+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Core Graphics
Declaration
void CGContextSetPatternPhase(CGContext Ref c, CGSize phase);
Parameters
c
The graphics context to modify.
phase
A pattern phase, specified in user space.
Discussion
The pattern phase is a translation that Core Graphics applies prior to drawing a pattern in the context. The pattern phase is part of the graphics state of a context, and the default pattern phase is (0,0)
. Setting the pattern phase has the effect of temporarily changing the pattern matrix of any pattern you draw. For example, setting the context’s pattern phase to (2,3)
has the effect of moving the start of pattern cell tiling to the point (2,3)
in default user space.