我想用一个特定的图像在UIImageView中绘制一些圆圈。这就是我要怎样做:在UIImageView中绘制形状IOS
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 2013-02-26 18:06:19