简体   繁体   English

在iOS上旋转相机视图

[英]Rotating camera view on iOS

I've read few questions here on stack and I'm in a dead-end. 我在这里已经读了几个问题了,我处于死胡同。 I want to have device (iPhone/iPad) camera as a background, to one of my ViewControllers . 我想将设备(iPhone / iPad)相机作为背景,连接到我的ViewControllers I'm using Storyboard and UINavigationsViewController , so I'm modyfing a child ViewController . 我正在使用StoryboardUINavigationsViewController ,所以我正在修改一个子ViewController As far as I read, this means that I cannot force this "child" to start in specific orientation (first problem). 据我所读,这意味着我不能强迫这个“孩子”以特定的方向开始(第一个问题)。 Secondly, I decided to go with UIImagePickerController , but as I got it right - you cannot rotate this component, right? 其次,我决定使用UIImagePickerController ,但是当我做对时-您不能旋转该组件,对吗?

So basically my question is where to go from here, to achieve camera view on background no matter what device orientation? 因此,基本上我的问题是,无论设备方向如何,要从哪里获得背景的相机视图? It surely can be done, because Vuforia ie has it (and they are using UIImagePickerController with EAGLView). 当然可以做到,因为Vuforia即拥有它(他们正在将UIImagePickerController与EAGLView一起使用)。

You have two options to do that task: 您可以通过两种选择来执行此任务:

1) You can use Eaglview to render the frames of camera device in background. 1)您可以使用Eaglview在后台渲染摄像头设备的帧。 2) You can use caeagllayer to do the same. 2)您可以使用caeagllayer进行相同的操作。

To draw on that layer you have to use drawableproperties and CaTransformationMatrix 要在该图层上drawableproperties ,必须使用drawablepropertiesCaTransformationMatrix

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

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