AV Foundation camera preview layer gets zoomed in, how to zoom out?

前端 未结 3 885
失恋的感觉
失恋的感觉 2020-12-31 12:37

The application currently I am using has a main functionality to scan QR/Bar codes continuously using Zxing library (http://code.google.com/p/zxing/). For continuous frame c

3条回答
  •  悲哀的现实
    2020-12-31 12:57

    This is a function of the AVCaptureSession video preset, accessible by using the .sessionPreset property. For example, after configuring your captureSession, but before starting it, you would add

    captureSession.sessionPreset = AVCaptureSessionPresetPhoto;
    

    See the documentation here:

    iOS Reference Document

    The default preset for video is 1280x720 (I think) which is a lower resolution than the max supported by the camera. By using the "Photo" preset, you're getting the raw camera data.

提交回复
热议问题