5

我正在使用AVCaptureSession带有重力AVCaptureVideoPreviewLayer的a。AVLayerVideoGravityResizeAspectFill

self.captureSession =[[AVCaptureSession alloc] init];
captureSession.sessionPreset = AVCaptureSessionPresetPhoto;
self.previewLayer = [[AVCaptureVideoPreviewLayer alloc] initWithSession:self.captureSession];
[self.previewLayer setVideoGravity: AVLayerVideoGravityResizeAspectFill];

如何知道如何调整视频大小以适应预览区域AVLayerVideoGravityResizeAspectFill?图像的哪个部分在预览区域中可见?

文档

AVLayerVideoGravityResizeAspectFill:保留纵横比,但填充可用屏幕区域,必要时裁剪视频

基本上,如何准确获取 previewLayer 中显示的内容?

4

1 回答 1

1

使用iOS 6 SDK,我可以AVCaptureVideoPreviewLayer

(CGPoint)captureDevicePointOfInterestForPoint:(CGPoint)pointInLayer
于 2012-11-30T13:21:04.733 回答