// 橡皮擦擦除
- (void) eraseDrawing {
UIGraphicsBeginImageContext(image.frame.size);//绘图上文
[image.image drawInRect:image.bounds];//绘图大小
CGContextClearRect(UIGraphicsGetCurrentContext(), CGRectMake(eraseButtonImg.frame.origin.x+10, eraseButtonImg.frame.origin.y+10, 30, 30));//在当前image下绘制
image.image = UIGraphicsGetImageFromCurrentImageContext(); //获取最新得image 第一个image为UIImageView,第二个image为UIImage
UIGraphicsEndImageContext();//绘图下文
}
擦除UIImageView
最新推荐文章于 2018-12-28 18:23:02 发布