开发者

How to smooth the edge of a zig-zag line?

Currently I draw a zig-zap line by CGContextMoveToPoint, CGContextAddLineToPoint, and CGContextStrokePath, following touchesMoved events. How can I smoo开发者_开发问答th 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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜