在UIImagePickerController中获取相机预览的图像表示 [英] Getting an image representation of the camera preview in UIImagePickerController

查看:87
本文介绍了在UIImagePickerController中获取相机预览的图像表示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用标准 [view.layer renderInContext:UIGraphicsGetCurrentContext()]; 方法将视图转换为iPhone相机模态视图中的图像时,我得到的只是黑色控件,相机预览的位置。

When I use the standard [view.layer renderInContext:UIGraphicsGetCurrentContext()]; method for turning views into images on the iPhone camera modal view, all I get is the controls with black where the camera preview was.

任何人都有解决方案吗?速度不是问题。

Anyone have a solution for this? Speed is not an issue.

推荐答案

不可能来自记录的api,但可能。在相机的子视图中找到PLCameraView视图,然后调用

Not possible from a documented api, but possible. Find the "PLCameraView" view in the camera's subviews, then call

CGImageRef img = (CGImageRef)[foundCameraView imageRef];

这将返回对相机所持图像的引用。

This will return a reference to the image that camera holds.

这篇关于在UIImagePickerController中获取相机预览的图像表示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆