标签:return capture ntc phi layer 取图 获取 apt etc
点击要切屏时点用此方法获取图片 image 极为切屏图片
- (UIImage *)captureImageFromView:(UIView *)view {
CGRect screenRect = [view bounds];
UIGraphicsBeginImageContext(screenRect.size);
CGContextRef ctx = UIGraphicsGetCurrentContext();
[view.layer renderInContext:ctx];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return image;
}
标签:return capture ntc phi layer 取图 获取 apt etc
原文地址:http://www.cnblogs.com/wujie123/p/6907662.html