在图像中捕获摄像机视图和onverlay [英] Capture camera view and onverlay in an image

查看:128
本文介绍了在图像中捕获摄像机视图和onverlay的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我打开相机视图,并将图像作为叠加层。
然后,我想将叠加层和摄像机视图的图像保存为一个图像。
以前,我使用UIGetScreenImage()实现了这一点。
现在,苹果禁止这是什么是我的选择?
takePicture只会捕获摄像机数据,但是覆盖。
合并覆盖与来自takePicture的图像有点慢。

I open the camera view and place an image as an overlay. I then want to save both the overlay and the camera view's image as one image. Previously I achieved this using UIGetScreenImage(). Now that Apple forbid this what are my options ? takePicture will only capture the camera data but the the overlay. Merging the overlay with the image from takePicture is a bit slow.

推荐答案

你真的需要合并他们,并且它不应该超过一秒或两秒。类似的东西(未经测试,但应该给出一个想法):

You really will have to merge them, and it shouldn't take more than a second or two. Something like(untested, but should give an idea):

UIGraphicsBeginImageContext(myCapturedImage.size);
[myCapturedImage drawAtPoint:CGPointZero]; //You might need to use drawInRect
[overlayImage drawAtPoint:CGPointZero];
UIImage *combinedImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();

这篇关于在图像中捕获摄像机视图和onverlay的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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