The code uses quartz (iPhone graphics engine) to clip the image. some details:
UIGraphicsBeginImageContext(s);
CGContextRef g = UIGraphicsGetCurrentContext();
First you need some kind of “target” for drawing. In graphics, this is usually called context. Above, you tell the system that you need an image context (bitmap) with a given size, and then you get a link to it.
CGContextAddPath(g,erasePath);
CGContextAddRect(g,CGRectMake(0,0,s.width,s.height));
CGContextEOClip(g);
, . , " ".
[img drawAtPoint:CGPointZero]
. , .
imageView.image = UIGraphicsGetImageFromCurrentImageContext();
, (),
: , , .