简体   繁体   English

``仅捕获''部分上的相机叠加视图

[英]Camera Overlay View on Just Capture Section

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. 我正在尝试在UIImagePickerController上添加cameraOverlayView ,但是我希望覆盖图仅覆盖显示相机将捕获的内容的屏幕部分,而不是“取消”按钮,“拍照”按钮,闪光灯设置或其他任何内容像那样。 How can I dynamically determine what the frame of the UIImageView of my overlay should be? 如何动态确定叠加层的UIImageView框架应该是什么?

I've attached an image to illustrate exactly the section I'm talking about. 我已附上一张图片,以准确说明我正在谈论的部分。

在此处输入图片说明

您可以使用AVCamCaptureManager来获取覆盖,该覆盖仅覆盖屏幕的一部分,该部分仅显示相机将捕获的内容,而不显示按钮

i had same situation, what i did, i created an UIImageView like follow: 我有同样的情况,我做了什么,我创建了一个UIImageView,如下所示:

    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! 是的,它确实有效!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM