if(UIGraphicsBeginImageContextWithOptions != NULL) { UIGraphicsBeginImageContextWithOptions(_view.frame.size, NO, 0.0); } else { UIGraphicsBeginImageContext(_view.frame.size); } [_view.layerrenderInContext:UIGraphicsGetCurrentContext()]; UIImage *cropImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext();
cropImage就是截下来的UIImage,将其写入本地