标签:
-(UIImage *)captureScreenWithRect:(CGRect)rect{
UIGraphicsBeginImageContextWithOptions(self.view.bounds.size, YES, 1);
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
UIImage *resultImg = [UIImage imageWithCGImage:CGImageCreateWithImageInRect(img.CGImage, rect)];
UIGraphicsEndImageContext();
return resultImg;
}
标签:
原文地址:http://www.cnblogs.com/dewengood/p/5141280.html