UIGraphicsBeginImageContext([[UIApplication sharedApplication] keyWindow].rootViewController.view.frame.size);
CGContextRef context = UIGraphicsGetCurrentContext();
[[[UIApplication sharedApplication] keyWindow].layer renderInContext:context];
UIImage *theImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageWriteToSavedPhotosAlbum(theImage, self, nil, nil);
网友评论