views:

19

answers:

1

So according to Apple's Quartz 2D Programming guide, there are a number of predefined line join styles when connected line segments in your path meet at a corner (Miter Join, Round Join, Bevel Join). I'm looking to do this with different colored lines, which I'm having trouble with.

According to the discussion here: http://stackoverflow.com/questions/3041776/iphone-cgcontext-drawing-two-lines-with-two-different-colors, in order to change the line color at some point along a path, you have to split that path into two parts. It seems like you have to stroke a path using color1, switch colors, then begin a new path using color2. However, because I'm splitting the path into two, it means that the Join Style won't apply anymore, since it only seems to apply to line segments that join as part of the same path.

Any ideas?

A: 

Can you make use of line-endcap styles?

Can you draw to two different views, then superimpose to get the effect you want?

You don't mention the desired join, but can you use erasure (and possible the composite view mentioned above) to get the effect you want?

What's the desired join?

Olie