![]() ![]() ![]() So, convert your path in to something you can fill, turn that in to a clip, and then draw your gradient. For example, you can clip to the stroked version of a path by calling this function followed by a call to the function CGContextClip. You can use this path in the same way you use the path of any context. ![]() The new path is created so that filling it draws the same pixels as stroking the original path. Quartz creates a stroked path using the parameters of the current graphics context. I'd speculate that the Core Graphics rendering engine probably does this anyway in calls to CGContextStrokePath. However, Core Graphics has an amazingly cool procedure CGContextReplacePathWithStrokedPath that will transform the path you intend to stroke in to a path that is equivalent when filled.īehind the scenes, CGContextReplacePathWithStrokedPath builds up an edge polygon around your stroke path and switches that for the path you have defined. ![]() Only filled paths use the gradient (when you turn them in to a clip and then draw the gradient). It is possible to stroke arbitrary paths with a gradient, or any other fill effect, such as a pattern.Īs you have found, stroked paths are not rendered with the current gradient. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |