我已经使用uigraphics cgcontext画线触摸...但我的线不光滑我的意思是边缘不光滑,所以任何人都可以建议我如何绘制流畅的线.. ?? 这里我的代码是我用来画线:如何在目标c中顺畅地绘制自由手线?
/* touchesBegan */
UITouch *touch = [touches anyObject];
lastPoint = [touch locationInView:imagevw];
/* touchesMoved */
CGFloat width = [mySlider value];
UIGraphicsBeginImageContext(imagevw.frame.size);
[imagevw.image drawInRect:CGRectMake(0, 0, imagevw.frame.size.width,imagevw.frame.size.height)];
CGContextSetLineCap(UIGraphicsGetCurrentContext(), kCGLineCapRound);
CGContextSetLineWidth(UIGraphicsGetCurrentContext(), width);
UITouch *touch = [touches anyObject];
mouseSwiped = YES;
CGPoint currentPoint = [touch locationInView:imagevw];
CGContextBeginPath(UIGraphicsGetCurrentContext());
CGContextMoveToPoint(UIGraphicsGetCurrentContext(), lastPoint.x, lastPoint.y);
CGContextAddLineToPoint(UIGraphicsGetCurrentContext(), currentPoint.x, currentPoint.y);
CGContextStrokePath(UIGraphicsGetCurrentContext());
imagevw.image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
lastPoint = currentPoint;
/* touchesEnded */
/* same here */
CGContextMoveToPoint(UIGraphicsGetCurrentContext(), lastPoint.x, lastPoint.y);
CGContextAddLineToPoint(UIGraphicsGetCurrentContext(), lastPoint.x, lastPoint.y);`
这是我的代码,我可以画线放手,但它不是平滑的显示像素我的意思是边缘不光滑
我已经试过这仍然这不是光滑....如果你知道任何其他可以请你寄给我,如果任何示例代码将是非常有益的。感谢advanc .. –