如何知道图片被CGContextClearRect 擦除了多少
各位,如何知道图片被CGContextClearRect 擦除了多少.我想将一张图片擦除到80%的时候就让他全部消失了.但是不知道如何计算擦除了多少像素.请高手帮忙
主要代码:
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *touch = [touches anyObject];
if(canEarse)
{
CGPoint currentPoint = [touch locationInView:reaseImage];
UIGraphicsBeginImageContext(self.reaseImage.frame.size);
[reaseImage.image drawInRect:reaseImage.bounds];
CGContextClearRect (UIGraphicsGetCurrentContext(), CGRectMake(currentPoint.x, currentPoint.y, 50, 50));
reaseImage.image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
}
}
demo下载地址:http://download.csdn.net/download/xiaohui1224/4318189