次のコードがありますが、滑らかではありません。私が円を描くと、鋭い角が見えます。iPhoneで指のスライド/タッチモーションで滑らかな線を描くにはどうすればよいですか?
UIGraphicsBeginImageContext(self.view.frame.size);
[drawImage.image drawInRect:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
CGContextSetLineCap(UIGraphicsGetCurrentContext(), kCGLineCapRound);
CGContextSetLineWidth(UIGraphicsGetCurrentContext(), 5.0);
CGContextSetAllowsAntialiasing(UIGraphicsGetCurrentContext(), YES);
CGContextSetRGBStrokeColor(UIGraphicsGetCurrentContext(), 1.0, 0.0, 0.0, 1.0);
CGContextBeginPath(UIGraphicsGetCurrentContext());
CGContextMoveToPoint(UIGraphicsGetCurrentContext(), lastPoint.x, lastPoint.y);
CGContextAddLineToPoint(UIGraphicsGetCurrentContext(), currentPoint.x, currentPoint.y);
CGContextStrokePath(UIGraphicsGetCurrentContext());
drawImage.image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
だけで簡単なメモ...あなたはあなたのUIGraphicsGetCurrentContextが右UIGraphicsBeginImageContext後に1回の呼び出しで呼び出して交換して変数に結果を保存したい場合があります。 1行ごとにUIGraphicsGetCurrentContextを呼び出す必要はありません。非効率で読みにくいです。 – v01d