1.忘记了从哪个地方看得了,原传送门不知道了,只做个记录
//截屏
- (UIImage*)snapshot:(UIView*)eaglview{
UIGraphicsBeginImageContextWithOptions(self.view.bounds.size, NO, 0.0);
// Render our snapshot into the image context
[eaglview drawViewHierarchyInRect:self.view.bounds afterScreenUpdates:NO];
// Grab the image from the context
UIImage *complexViewImage = UIGraphicsGetImageFromCurrentImageContext();
// Finish using the context
UIGraphicsEndImageContext();
扫描二维码关注公众号,回复:
5037290 查看本文章
return complexViewImage;
}