특정 이미지로 UIImageView 내부에 원을 그리려합니다.UIImageView에서 도형 그리기
UIGraphicsBeginImageContext(self.view.bounds.size);
CGContextRef contextRef = UIGraphicsGetCurrentContext();
CGContextSetLineWidth(contextRef, 2.0);
CGContextSetStrokeColorWithColor(contextRef, [color CGColor]);
CGRect circlePoint = (CGRectMake(coordsFinal.x, coordsFinal.y, 50.0, 50.0));
CGContextStrokeEllipseInRect(contextRef, circlePoint);
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
[photoView addSubview:image];
원 잘 그려,하지만 난에서 PhotoView가에 마스크 역할을하고 싶습니다 : 이것은 내가하려고했던 것입니다. 예를 들어 UIImageView를 애니메이션을 사용하여 UIView 밖으로 이동하는 경우 원을 그와 함께 움직이고 싶습니다. 중요한 것은 좌표가 전체 화면에 상대적이라는 사실입니다.
나에게 사용자 지정 UIView 또는 파생 된 사용자 지정 UIImageView 같은 소리. – trumpetlicks