//截取屏幕demoView
UIGraphicsBeginImageContext(demoView.bounds.size);
[demoView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage* image=UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
//保存到沙盒路径
NSArray* path=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString* filePath=[[path objectAtIndex:0] stringByAppendingPathComponent:[NSString stringWithFormat:@"1.png"]];
BOOL result=[UIImagePNGRepresentation(image)writeToFile:filePath atomically:YES];
// NSLog(@"%@",filePath);
if (result) {
//成功后取出image
NSArray* path=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString* filePath=[[path objectAtIndex:0] stringByAppendingPathComponent:[NSString stringWithFormat:@"1.png"]];
UIImage* image=[UIImage imageWithContentsOfFile:filePath];
}