5
客観CでtouchesMovedイベントでスムーズに動作していない、それは、部分的に動作しますが、画像は私はコードの下にしようとした後、以前と同じ問題に直面して適切に output seen like thisCGContextClearRectが、私はこのコードを使用し
-(void)touchesMoved:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
UITouch *touch = [touches anyObject];
CGPoint currentPoint = [touch locationInView:_img.superview];
UIGraphicsBeginImageContext(self.img.frame.size);
[_img.image drawInRect:CGRectMake(0, 0, _img.frame.size.width, _img.frame.size.height)];
CGContextSetLineCap(UIGraphicsGetCurrentContext(), kCGLineCapRound);
CGContextSetLineWidth(UIGraphicsGetCurrentContext(), 10);
CGContextBeginPath(UIGraphicsGetCurrentContext());
CGContextClearRect (UIGraphicsGetCurrentContext(), CGRectMake(currentPoint.x, currentPoint.y, 15, 15));
CGContextStrokePath(UIGraphicsGetCurrentContext());
_img.image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
}
ありがとうございますviraj Padsalaは私のために働きます! –