Iphone cameraOverlayView在UIImagePickerController中裁剪结果
当我将Iphone cameraOverlayView在UIImagePickerController中裁剪结果,iphone,uiimagepickercontroller,ios,Iphone,Uiimagepickercontroller,Ios,当我将UIImagePickerController与cameraOverlayView一起使用时,我是否可以从覆盖视图中获取唯一的选择区域 将UIImageView作为子视图添加到cameraOverlayView 创建大小为320x480的黑色PNG图像。在中间切成一个矩形以产生一个孔(透明像素)。 将PNG图像指定给UIImageView 或者,您可以像这样覆盖cameraOverlayView的-(void)drawRect:(CGRect)rect(未经我的测试): 我在Faces应
UIImagePickerController
与cameraOverlayView
一起使用时,我是否可以从覆盖视图中获取唯一的选择区域
-(void)drawRect:(CGRect)rect
(未经我的测试):
我在Faces应用程序()中也做了类似的操作。如果其中一个步骤不清楚,请随时写评论。哪一类是cameraoverlayview?@Phil:
cameraoverlayview
是图像选择器控制器的属性,仅作为UIView
公开:
// Request draw context
CGContextRef context = UIGraphicsGetCurrentContext();
// Draw background
CGContextSetRGBFillColor(context, 0.0f, 0.0f, 0.0f, 1.0f);
CGContextFillRect(context, rect);
// Cut hole
CGContextSetBlendMode(context, kCGBlendModeClear);
CGContextFillRect(context, CGRectMake(40, 40, 100, 100);