次のように、コンテキストにベジエパスを追加しました
for (Face* face in facesArray) {
UIBezierPath* customPath = [UIBezierPath bezierPath];
[customPath moveToPoint:face.rightEyePosition];
[customPath addQuadCurveToPoint:face.leftEyePosition controlPoint:face.foreheadPosition];
[customPath addQuadCurveToPoint:face.mouthPosition controlPoint:face.lowerLeftContrlPoint];
[customPath moveToPoint:face.rightEyePosition];
[customPath addQuadCurveToPoint:face.mouthPosition controlPoint:face.lowerRightContrlPoint];
UIGraphicsBeginImageContextWithOptions(originalImage.size, NO, 0.0);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextBeginPath (context);
CGContextAddPath(context,customPath.CGPath);
CGContextClosePath (context);
CGContextClip (context);
[imageView.image drawInRect: CGRectMake(0, 0, imageView.image.size.width, imageView.image.size.height)];
UIImage* resultImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
}
上記のコードは、ベジエ形状に従って画像をトリミングします。トリミングされた画像の境界線を透明にしたい。ベジエ パスのコーナーに透明度を設定するにはどうすればよいですか