![](/img/trans.png)
[英]UIImagePickerController's cameraOverlayView is not displaying in iOS 8
[英]cameraOverlayView to crop the result in UIImagePickerController
或者你可以像这样覆盖你的cameraOverlayView's - (void)drawRect:(CGRect)rect
(我的头脑中未经测试):
// 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);
我在Faces应用程序( http://faces.pixelshed.net/ )中做了类似的事情。 如果其中一个步骤似乎不清楚,请随意写评论。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.