チョークのように線を引きたい。そして、線のエッジがかすんでいます。黒板にチョークで描くのと同じように。
どうすれば入手できますか? さて、画像を使って線を引いてみましたが、かすれていないので黒板に描いたようには見えません。いくつかの提案をお願いします。
これが私のコードです:
for (NSDictionary *dictStroke in self.arrayStrokes)
{
NSArray *arrayPointsInstroke = [dictStroke objectForKey:@"points"];
//UIColor *color = [dictStroke objectForKey:@"color"];
UIColor *color = [UIColor colorWithPatternImage:[UIImage imageNamed:@"point.png"]];
float size = [[dictStroke objectForKey:@"size"] floatValue];
[color setStroke]; // equivalent to both setFill and setStroke
// draw the stroke, line by line, with rounded joints
UIBezierPath* pathLines = [UIBezierPath bezierPath];
CGPoint pointStart = CGPointFromString([arrayPointsInstroke objectAtIndex:0]);
[pathLines moveToPoint:pointStart];
for (int i = 0; i < (arrayPointsInstroke.count - 1); i++)
{
CGPoint pointNext = CGPointFromString([arrayPointsInstroke objectAtIndex:i+1]);
[pathLines addLineToPoint:pointNext];
}
pathLines.lineWidth = size;
pathLines.lineJoinStyle = kCGLineJoinRound;
pathLines.lineCapStyle = kCGLineCapRound;
[pathLines stroke];
arraynum++;
}