【发布时间】:2013-06-24 15:54:34
【问题描述】:
大家, 我想在相机上制作圆形蒙版。
我试试这个方法:
- (void)drawRect:(CGRect)rect
{
// Drawing code
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextAddArc(context, self.frame.size.width/2, self.frame.size.height/2, 200, 0, M_PI *2, 0);
//Set the stroke color to black
[[UIColor blackColor]setStroke];
//Define line width and cap
CGContextSetLineWidth(context, 200);
CGContextSetLineCap(context, kCGLineCapButt);
//draw it!
CGContextDrawPath(context, kCGPathStroke);
}
只需设置足够大的线,但我认为它可以设置 alpha。
谢谢。
【问题讨论】:
标签: ios camera uiimagepickercontroller mask geometry