When I use UIImagePickerController
with cameraOverlayView
, can I get the only a selective region from my overlay view?
Alternatively you could overwrite your cameraOverlayView's - (void)drawRect:(CGRect)rect
like this (untested out of my head):
// 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);
I have done something similar in my Faces app ( http://faces.pixelshed.net/ ). Feel free to write a comment if one of the steps seems unclear.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.