我只是在开发一个绘图应用程序。我需要绘制一条透明线,每当我绘制时,我都会出现在线上的点。
我该如何纠正这个问题?如何从线上删除点?
我的代码在这里
- (UIImage *)drawSmoothLine // stright line correct
{
CGPoint mid1 = midPoint(previousPoint1, previousPoint2);
CGPoint mid2 = midPoint(currentPoint, previousPoint1);
CGSize screenSize = self.frame.size;
UIGraphicsBeginImageContext(screenSize);
CGContextRef context = UIGraphicsGetCurrentContext();
[self.layer drawInContext:context];
CGContextMoveToPoint(context, mid1.x, mid1.y);
CGContextAddQuadCurveToPoint(context, previousPoint1.x, previousPoint1.y, mid2.x, mid2.y);
CGContextSetLineCap(context, kCGLineCapRound);
CGContextSetStrokeColorWithColor(context, drawColor.CGColor);
CGContextSetBlendMode(context, kCGBlendModeColorBurn);
CGContextSetLineWidth(context, lineWidth);
CGContextStrokePath(context);
UIImage *ret = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return ret;
}
Ipad screen shot of bug http://dc471.4shared.com/img/3_9Uo8qT/s3/Screen_shot_2012-06-15_at_1564.png