【发布时间】:2015-12-17 23:42:21
【问题描述】:
我有一个 UIBezierPath,我想从形状像路径的源图像中获取 PNG 图像。
UIGraphicsBeginImageContextWithOptions(sourceImage.size, NO, 0);
[bpath addClip];
[sourceImage drawAtPoint:CGPointZero];
UIImage *maskedImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
但是 maskedImage 是空的。当我使用路径测试填充时,我的路径似乎是有效的。请建议我如何获得像 UIBezierPath 形状的图像部分
【问题讨论】:
标签: ios objective-c uibezierpath