【发布时间】:2012-05-17 01:54:11
【问题描述】:
我有一个需要剪切的 AVCaptureVideoPreviewLayer,以便它很好地位于我的图像上,其中包含需要看到的透明部分。
从 AVCaptureVideoPreviewLayer 中剪切形状的最佳/有效方法是什么?
我已经设法使用 CAShapeLayer 获得正确的形状,但似乎 AVCaptureVideoPreviewLayer 没有 Path 属性来做同样的事情。
cameraLayer = [[CAShapeLayer layer] retain];
CGRect rect = CGRectMake(64, 32, 190 , 152);
CGMutablePathRef path = CGPathCreateMutable();
CGPathAddEllipseInRect(path, NULL, rect);
cameraLayer.path = path;
CGPathRelease(path);
*如果可以从 UIView 或 Imageview 中剪切出一个形状,我应该也可以做我想做的事情
谢谢
【问题讨论】:
标签: iphone objective-c avfoundation calayer cashapelayer