0
이것은 내 코드입니다. 이 코드를 사용하여 imageView.image
만 지우고 있지만 이미지 뷰 하위 뷰도 지우고 싶습니다. imageView에서 하위 뷰를 지우려면 어떻게해야합니까?보기에서 하위보기를 지우는 방법은 무엇입니까?
UIGraphicsBeginImageContext(imageView.frame.size);
[imageView.image drawInRect:CGRectMake(0, 0, imageView.frame.size.width, imageView.frame.size.height)];
CGContextSetLineCap(UIGraphicsGetCurrentContext(),kCGImageAlphaNone); //kCGImageAlphaPremultipliedLast);
CGContextSetLineWidth(UIGraphicsGetCurrentContext(), 10);
CGContextSetRGBStrokeColor(UIGraphicsGetCurrentContext(), 1, 0, 0, 10);
CGContextBeginPath(UIGraphicsGetCurrentContext());
CGContextMoveToPoint(UIGraphicsGetCurrentContext(), point.x, point.y);
//this line code for erasing select the part of the image
CGContextClearRect (UIGraphicsGetCurrentContext(), CGRectMake(point.x, point.y, 30, 30));
//End the code
CGContextStrokePath(UIGraphicsGetCurrentContext());
imageView.image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();