I’m trying to find out how to draw a path, and then fill it with content from an image, e.g. a .png. I have tiles of various shapes (square, triangle, etc., each defined by an NSBezierPath. I can fill them with solid color, but I also want to be able to fill them with some kind of bitmap image instead of solid color.
Share
Jarret’s answer is probably the best option, but if you wanted to avoid messing with the graphics context, you could also use
NSColor‘s+colorWithPatternImage:class method. This basically lets you use an image anywhere you would normally use a color.