In my iPhone application, I need to provide the user with a clip provided by the user UIImage, given the dynamically created one CGPath.
Everything that is outside the specified (closed) CGPathshould be cropped, and the resulting image should be cropped with a rectangle that bounds the path.
The image should be cropped with a soft frame. That is, there should be a soft gradient in the alpha channel at the edge of the clipping path, from transparent to opaque pixel.
Is there an affordable solution to achieve the described effect?
The main problem is how to get this soft gradient. I thought about rasterizing my CGPathmask and blurring it after rasterizing it, but I did not find anything about blurring in the iPhone API & hellip;
Regarding clipping, I planned to use the data CGPathGetBoundingBox, but the re-reading documentation tells me that as a result, the bounding box will include control points for Bezier and quadratic curves, which is unacceptable to me. Well, the old image scan for non-zero alpha pixels should do the job instead.
source
share