Could someone please show me how to create a CGPattern that I can use to stroke a path with an image?
cgcontext, core-graphics, iphone
Solution
See the relevant chapter of the Quartz 2D Programming Guide and the reference documentation for CGPattern.
The essential detail that's buried in the Programming Guide under pages and pages of “LOOK PRETTY PATTERNS” is that you need to write a callback function that draws one instance of the pattern, and pass the pointer to that callback to `CGPatternCreate`. When you draw the pattern, Quartz will call your callback, then tile whatever you drew.
Problem
I want to stroke a path using a .png that I have but I just don't know hot to make a CGPatternRef.