gpt4 book ai didi

iphone - AVLayerVideoGravityResizeAspectFill 在哪里裁剪

转载 作者:可可西里 更新时间:2023-11-01 04:53:51 26 4
gpt4 key购买 nike

我正在使用 AVCaptureSessionAVCaptureVideoPreviewLayer 以及 AVLayerVideoGravityResizeAspectFill 重力。

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

如何使用 AVLayerVideoGravityResizeAspectFill 了解如何调整视频大小以适应预览区域?图像的哪一部分在预览区域中可见?

来自 the doc :

AVLayerVideoGravityResizeAspectFill: This preserves the aspect ratio, but fills the available screen area, cropping the video when necessary

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

最佳答案

随着iOS 6 SDK I can use the followingAVCaptureVideoPreviewLayer

(CGPoint)captureDevicePointOfInterestForPoint:(CGPoint)pointInLayer

关于iphone - AVLayerVideoGravityResizeAspectFill 在哪里裁剪,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13643769/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com