#pragma mark 获取截屏图片
-(UIImage *)captureScreenForView:(UIView *)currentView {
UIGraphicsBeginImageContextWithOptions(CGSizeMake(currentView.size.width, currentView.size.height), NO, 0.0);//原图
[currentView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return viewImage;
}
网友评论