Currently I draw a zig-zap line by CGContextMoveToPoint
, CGContextAddLineToPoint
, and CGContextStrokePath
, following touchesMoved
events. How can I smooth the edges of the line? Such that when the user draw a circle-like shape, the circle can be more round'ed. The GLPaint example use OpenGL, is that the only way to do it?
views:
127answers:
1
+2
A:
You can simply set the line join to round, to make the edges less visible:
CGContextSetLineJoin(ctx, kCGLineJoinRound);
Other than that you option would be to use some kind of spline interpolation.
Nikolai Ruhe
2010-05-10 10:56:23