2

I am trying to add a cameraOverlayView on a UIImagePickerController, but I want the overlay to cover just the part of the screen that shows what will be captured by the camera, not the "Cancel" button, take photo button, flash settings, or anything like that. How can I dynamically determine what the frame of the UIImageView of my overlay should be?

I've attached an image to illustrate exactly the section I'm talking about.

enter image description here

2

2 Answers 2

6

you can use AVCamCaptureManager to get overlay which cover just the part of the screen that shows what will be captured by the camera only , not buttons

Sign up to request clarification or add additional context in comments.

3 Comments

Could you be more specific? AVCamCaptureManager is not a class in any iOS framework.
Yes sure, It is a 3rd party library tool. this link will help you more github.com/OpenWatch/AVCam
Is there a modern way to achieve this same functionality?
0

i had same situation, what i did, i created an UIImageView like follow:

    myview                 = [[UIImageView alloc]init];
    myview.frame            =  CGRectMake(0, 68, 320, 430);
// note that these frames were as per my needs, you can manipulate them as per yours.

then add this image view as

myImagePicker.cameraOverlayView   = myview;

try this with setting some background color and check whether its covering entire camera part or not, you would just need to set frames, thats all!!!

And yes it does work!

2 Comments

Yes, I realize that setting the frame is the solution. What I'm wondering is how to dynamically calculate the frame, as opposed to just figuring out magic numbers.
I have managed to add an overlayview but the problem is , when I am taking the picture i just want to take the part inside the overlayView. Did you managed to do that ? stackoverflow.com/a/56187599/8732045

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.