ios - 创建用于读取 QR 码的相机叠加层

标签 ios objective-c camera overlay qr-code

我正在使用一个使用 QR 码读取功能的应用程序,但我想在相机上进行叠加,例如相机的某些部分将读取 QR 码,而屏幕上的其他 View 将显示模糊效果,假设屏幕尺寸为 375*667所以相机将在 View 的中心打开将帧大小

X: 64pt
Y: 210pt
W: 247.5pt
H: 247.5pt

可以读取代码,屏幕的其他部分将具有透明模糊效果。

最佳答案

也许这些教程会帮助你:

  • YouTube Tutorial by "Jared Davidson" about Custom Camera Views
  • App Coda Tutorial about how to create a barcode reader app (contains information about AVFoundation)

  • The AV Foundation Framework provides the tools that we will use to build our barcode reader. Here’s a little rundown of what’s involved in the process.

    AVCaptureSession will manage data form the camera – input to output. The AVCaptureDevice is the physical device and its properties. AVCaptureSession receives input data from the AVCaptureDevice. AVCaptureDeviceInput captures data from the input device. AVCaptureMetadataOutput forwards metadata objects to be processed by a delegate object.



    也许这会有所帮助:
    How to add a blur mask with a custom shape above a dynamic camera view in Swift?

    关于ios - 创建用于读取 QR 码的相机叠加层,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41300685/

    相关文章:

    objective-c - NSOutlineView 更改组行颜色

    ios - 为什么使用 UI GraphicsContext 裁剪图像时会出现白边?

    ios - 从聊天室中过滤掉不合适的词

    objective-c - 使用 NSMutableArray 的问题

    objective-c - 如何在 ObjectiveC 类中存储函数指针?

    安卓2.2。人像相机预览

    Swift - 状态栏(电池)显示在相机上

    iphone - 在 appdelegate.m 文件中找不到 viewcontroller

    ios - IAP 恢复按钮

    ios - Swift 3 中具有模糊效果的背景自定义相机 View