简体   繁体   English

使用AVCapture捕捉高质量图像的简单方法

[英]Simple way to capture a high quality image with AVCapture

All I need to do is capture an image, and all I can find is complicated code on capturing video or multiple frames. 我所需要做的就是捕获图像,而我所能找到的就是捕获视频或多帧图像的复杂代码。 I can't use UIImagePickerController because I do not want to see the camera shutter animation and I have a custom overlay, and my app is landscape only. 我不能使用UIImagePickerController,因为我不想看到相机的快门动画,并且有一个自定义叠加层,并且我的应用程序仅是横向的。 What is the simplest way to manually capture an image from the front or back live camera view in the correct orientation? 以正确的方向从正面或背面实时摄像头视图手动捕获图像的最简单方法是什么? I don't want to save it to the camera roll, I want to present it in a view controller for editing. 我不想将其保存到相机胶卷中,我想将其呈现在视图控制器中进行编辑。

Take a look to the SquareCam ( http://developer.apple.com/library/ios/#samplecode/SquareCam/Introduction/Intro.html ) example from Apple. 看看Apple的SquareCam( http://developer.apple.com/library/ios/#samplecode/SquareCam/Introduction/Intro.html )示例。 It contains all what you need for high-quality capture of images. 它包含了高质量捕获图像所需的一切。 I recently copy-pasted the code from this project myself where I solved the same task as you. 我最近亲自复制了该项目中的代码,在那里我完成了与您相同的任务。 It works well :) 它很好用:)

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

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