views:

406

answers:

2

I'm looking for a way to draw a curve (perhaps a parametric function?) into a CGContext

The best example which I can think of is the Adobe Ideas iPad application. As the user drags their finger, the application draws lines for every touchesMoved: using CGContextAddLineToPoint. After the user picks up their finger at touchesEnded:, the application does some math and replaces all of the lines with a single, smoothed curve.

What I have is a list of CGPoints, and I am looking to draw a smooth curve which follows those CGPoints into the CGContext.

Any assistance?

+1  A: 

I'd advise creating a CGPathRef and use the CGPathAddQuadCurveToPoint method.

Hope this helps!

adam
A: 

Did you work out the best way to do this? I too am looking for a simplistic version of Adobe Ideas to draw a smooth curve.

RaelG