从前置摄像头iOS 5.0捕捉时总是看到镜像
从Front摄像头捕捉数据时,我总是得到Mirror镜像,我怎么能在预览窗口中看到我所看到的。 我已经将videoMirrored
设置为TRUE
。 以下是代码片段:
AVCaptureConnection *lConnection = nil; for ( AVCaptureConnection *connection in [lHandle->m_output connections]) { for ( AVCaptureInputPort *port in [connection inputPorts] ) { if ( [[port mediaType] isEqual:AVMediaTypeVideo] ) { lConnection = connection; break; } } } if ([lConnection isVideoOrientationSupported]) [lConnection setVideoOrientation:AVCaptureVideoOrientationPortrait]; if ([lConnection isVideoMirroringSupported]) [lConnection setVideoMirrored:TRUE];
将setVideoMirrored
更改为True/False
也不会更改任何内容( isVideoMirroringSupported
返回Success)
用以下代码翻转镜像。
UIImage * flippedImage = [UIImage imageWithCGImage:picture.CGImage scale:picture.scale orientation:UIImageOrientationLeftMirrored];
Swift
版本:
let flippedImage = UIImage(CGImage: image.CGImage, scale: image.scale, orientation: .LeftMirrored)
- 初始化使得整型指针没有强制转换
- 批量优化的iPhone / iPad的PNG显示Xcode做
- iOS – Dropbox上传到“应用程序文件夹”
- 为什么不自动从一个Nib加载的视图被didReceiveMemoryWarning发布之后呢?
- iOS中一个页面上的多个HTML5媒体元素(iPad)
- 在AppDelegate中使用Swift UINavigationBar setBackgroundImage
- Xcode错误 – 终止应用程序由于未捕获的exception“NSUnknownKeyException”,原因:':
- XCTest:捆绑“目标testing”无法加载,因为它的可执行文件无法find
- 解散和代表UIImagePickerController摄像头iOS8.4的问题