views:

148

answers:

1

I want to stroke a path using a .png that I have but I just don't know hot to make a CGPatternRef.

+1  A: 

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.

Peter Hosey