截图:
//截图
- (UIImage*)captureView:(UIImageView*)theView
{
CGRect rect = theView.frame;
UIGraphicsBeginImageContext(rect.size);
CGContextRef context = UIGraphicsGetCurrentContext();
[theView.layer renderInContext:context];
UIImage* img = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return img;
}
图片旋转用;
image = [UIImage imageWithCGImage:image.CGImage scale:1.0 orientation:UIImageOrientationRight];
//我的5s拍的照片Orientation 都是等于3的,也就是等于UIImageOrientationRight