How to set camera zoom level using AVFoundation framework in IOS?

I am developing a custom camera where the camera is set to capture mode. I need to increase the zoom level of the camera preview as required by the application. The preview is currently displaying perfectly, I just need to zoom in on the current preview. I have searched through the internet but couldn't find a solution. Please tell me how I can do this. I am attaching an example image for better understanding. the first image of my camera app and the second image is the Scanner Pro appwhich shows a view with a more closed area, while I focus both apps on the same object at the same distance. My camera has no room, but the scanner camera has scatter throughout the image. Both cameras are at the same distance from the paper.

enter image description here

+3


source to share


2 answers


I don't know if you need this answer. Probably not, but still for you and everyone else:



When you set a session preset, try using SessionPresetPhoto

for the device object. This should fix the weird scaling issue.

0


source


Your preview view is probably spreading around the edge of the screen. Make sure this is a 4: 3 aspect ratio and that it does not overflow the edges of the screen. With this, you should see more of your image.



0


source







All Articles