cocoa - On OSX, how do I gradient fill a path stroke? -


using plethora of drawing functions in cocoa or quartz it's rather easy draw paths, , fill them using gradient. can't seem find acceptable way however, 'stroke'-draw path line width of few pixels , fill stroke using gradient. how done?

edit: apparently question wasn't clear enough. responses far, figured out. want this:

squares http://emle.nl/forumpics/misc/squares.png

the left square nsgradient drawn in path followed path stroke message. right want do; want fill stroke using gradient.

if convert nsbezierpath cgpath, can use cgcontextreplacepathwithstrokedpath() method retrieve path outline of stroked path. graham cox's excellent gcdrawkit has -strokedpath category method on nsbezierpath without needing drop down core graphics.

once have outlined path, can fill path nsgradient.


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -