UIGraphicsBeginImageContextWithOptions(self.window.bounds.size, NO, 0);
[self.window drawViewHierarchyInRect:self.window.bounds afterScreenUpdates:YES];
UIImage *im = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
代码如上图 记录一下