标签:cal 密度 update logs image begin screen tps current
#pragma mark - 屏幕快照 - (UIImage *)convertViewToImage:(UIView *)view { //https://github.com/alskipp/ASScreenRecorder 录屏代码 // 第二个参数表示是否非透明。如果需要显示半透明效果,需传NO,否则YES。第三个参数就是屏幕密度了 UIGraphicsBeginImageContextWithOptions(view.bounds.size,YES,[UIScreen mainScreen].scale); [view.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return image; } - (UIImage *)snapsHotView:(UIView *)view { UIGraphicsBeginImageContextWithOptions(view.bounds.size,YES,[UIScreen mainScreen].scale); [view drawViewHierarchyInRect:view.bounds afterScreenUpdates:NO]; UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return image; }
标签:cal 密度 update logs image begin screen tps current
原文地址:http://www.cnblogs.com/tomblogblog/p/6338081.html