I have two UIImageView, first the second. I want to remove part of the first image with a brush (the brush is a png image with a soft edge) to make part of the second image visible.
I did it as follows:
1) touchhesMoved and [self setNeedsDisplayInRect: [self brushRectForPoint: touch_location]];
2) in (void) drawRect: (CGRect) rect I call [_ brush drawAtPoint: touch_location blendMode: kCGBlendModeDestinationOut alpha: 1];
It works fine, but the frequency of touchhesMoved is not enough, if the user moves the finger too fast, then I get a lot of short lines (or even dots) instead of one long line.
I found information about UIBezierPath and an example , but the author just draws the lines along the path:
CGContextRef context = UIGraphicsGetCurrentContext(); CGContextAddPath(context, path); CGContextSetLineCap(context, kCGLineCapRound); CGContextSetLineWidth(context, self.lineWidth); CGContextSetStrokeColorWithColor(context, self.lineColor.CGColor); CGContextStrokePath(context);
How can I paint my png brush using UIBezierPath?
I need something like this

Thanks a lot!
source share