以编程方式绘制粗略的线条

我想知道你们是否有任何想法,可以在iOS应用程序上绘制粗略的线条。 目前我正在绘制一个UIBezierPath,然后渲染成位图graphics上下文。 我怎么能让这条线看起来粗略?

// Produce and add points to draw in the UIBezierPath // Draw the path into the Bitmap context UIGraphicsBeginImageContext(self.bounds.size); [frameBuffer drawAtPoint:CGPointMake(0, 0) blendMode:kCGBlendModeCopy alpha:1.0]; [[datasource lineStrokeColorForSketchCanvas:self] setStroke]; [curvePath stroke]; image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); 

非常感谢您提前:)

我会build议使用一小批“粗略”线条纹理,然后使用这些+ UIBezierPath将粗略的图像沿着正确的旋转path放置。

你可以将它们绘制到上下文中,并保存它们,以便不必每次都生成它们。

阐述:

从UIBezierPath的一端开始,每一个x都指向path,绘制一个以该点为中心的粗略线段,继续前进,直到到达path的末端。