
I am creating a CGPath region as shown in the green circle. The CGPath area should be transparent, and the rest of the image will be blurry or translucent, I can crop the image inside CGPath with the following code:
UIGraphicsBeginImageContext(view.frame.size); CGContextAddPath(ctx, path); CGContextClip(ctx); [view.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *clipImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); UIImageWriteToSavedPhotosAlbum(clipImage, nil, nil, nil); CGPathRelease(path);
but I donβt know how to apply a blurry or translucent effect with CGPath at the same time. I think I can blur the original image and combine it with the image of the clip, but I donβt know how to implement it.
NOrder source share