1

I'm familiar with UIBezierPath and the corresponding CG routines, but none of them appear to draw the same type of path as what I see in Photoshop, etc.

How would one go about this? I'm just talking about the UI--letting the user drag around points.

Five point curve example

A java example I found is here: http://www.cse.unsw.edu.au/~lambert/splines/natcubic.html

akaru
  • 6,299
  • 9
  • 63
  • 102

1 Answers1

1

I would look into CGContextAddCurveToPoint and drag around curve's control points. If you require more control points to create a complex curve, just split a resulting curve into simple segments.

Take a look at this article It explains how to calculate the control points based on knots you have on your curve.

PrimeSeventyThree
  • 940
  • 2
  • 9
  • 24
  • I guess my main issue was where to place the control points. They're not the actual points as shown, as those are endpoints. – akaru Nov 04 '11 at 19:23
  • Well here is a simple Mac app example which I think you can get the idea from: http://cocoawithlove.com/2008/07/coregraphics-curves-and-lines-sample.html – PrimeSeventyThree Nov 04 '11 at 20:46
  • Thanks. I'd checked that out a few days ago...still couldn't understand how to place control points in order to get the same kind of curvature. – akaru Nov 05 '11 at 06:57