現在、次のように UIBezierPath 内で UIImage を描画しています。
UIGraphicsBeginImageContextWithOptions(rect.size, NO, 0);
UIBezierPath *polygonPath = [UIBezierPath bezierPath];
CGPoint curPoint = [self originalPoint:[[drawArray objectAtIndex:0]CGPointValue]];
// set the starting point for the lines
[polygonPath moveToPoint:curPoint];
// go through each point in drawArray and add it to polygonPath
for(NSInteger i = 1; i < [drawArray count]; i++) {
curPoint = [self originalPoint:[[drawArray objectAtIndex:i]CGPointValue]];
// scale point
curPoint = CGPointMake(curPoint.x, curPoint.y);
[polygonPath addLineToPoint:curPoint];
}
[polygonPath closePath];
[polygonPath addClip];
[image drawAtPoint:CGPointZero];
それはうまく機能しますが、別の画像の上に描画しているので、画像に少し透明な「滑らかなエッジ」が必要です...現在、エッジはかなり粗いです。
ご協力いただきありがとうございます!