//(1)设置要截屏的图片的大小
UIGraphicsBeginImageContextWithOptions(某个view.frame.size,NO,0); //不模糊
// UIGraphicsBeginImageContext(self.view.frame.size); //模糊
//(2)对哪个视图截图固定大小的图片
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
//(3)获取截图的图片对象
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
//(4)结束绘制图片
UIGraphicsEndImageContext();
//(5)保存到相册
UIImageWriteToSavedPhotosAlbum(image, nil,nil, nil);