I want to stroke a path using a .png that I have but I just don’t know hot to make a CGPatternRef.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.