On Aug 24, 2008, at 2:34 AM, Frank Illenberger wrote:
does anybody know if there is a way in Quartz under Mac OS 10.5 to
stroke a path with a gradient/shading but without using a pattern
What effect are you trying to achieve?
I want to fill a shape with a gradient and then stroke the contour of
the shape with a dashed line whose color should also change according
to the gradient. Under Tiger I used to solve this by drawing a solid
gradient in to an NSImage, then turning this image into a pattern
color by using colorWithPatternImage:, setting the correct pattern
phase for my drawing location and then simply fill and stroke the
path. Now, under Leopard I want to get rid of the overhead of creating
NSImages and pattern colors.
You can use CGContextReplacePathWithStrokedPath() followed by
CGContextClip() to do some types of effects, but depending on what
you are specifically trying to do this may or may not be what your
This sounds like a solution to my problem. I will try if it works.
By the way: Do you know what the best solution is for drawing a drop
shadow together with a gradient fill? As regular gradient drawing uses
clipping, every shadow drawn outside of the shape naturally gets
clipped. I currently solve this by filling the path with a solid color
plus a shadow and then filling the gradient on top of this. Do you
know if there is a way to avoid this double filling of the shape?
Do not post admin requests to the list. They will be ignored.
Quartz-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden