从相机视图中截取屏幕截图 [英] Take screenshot from camera view

查看:236
本文介绍了从相机视图中截取屏幕截图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

已更新



我正在使用



此截图应如何:



这个问题是公共的,我看到很多用户都有相同的问题,他们无法截取相机视图的截图,但没有给出有用的答案。

解决方案

要解决这个问题,我要将视频通话摄像头从后置摄像头切换到前置摄像头,以便用户可以使用后置摄像头拍照,拍照我将视频通话切换回后置摄像头。


Updated

I'm using the sinch library to make video call in my app. I've button to take screenshot for the whole screen during the video call :

   @IBAction func photoAction(_ sender: Any) {

    let result = UIImage(view: self.videoView)
    UIImageWriteToSavedPhotosAlbum(result, nil, nil, nil)

    let result2 = UIImage(view: self.videoController!.localView())
    UIImageWriteToSavedPhotosAlbum(result2, nil, nil, nil)

}

call is SINClient
videoController is SINVideoController
localView is UIView, the camera view

The screenshot function work fine but the camera view is not appearing in the screenshot.

for example, this's screenshot self.view programmatically :

and this screenshot how it should be :

This problem's commun and I've seen many user having the same issue that they can't take screenshot for the camera view but no helpful answer was given.

解决方案

To solve this issue, I'had to switch the video call camera from back to front camera so that user could user the back camera to take photo, once he done with taking photo I switch back the video call to back camera.

这篇关于从相机视图中截取屏幕截图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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