ios 截图.image的旋转问题

来源:互联网 发布:网络兼职正规网站 编辑:程序博客网 时间:2024/04/27 21:09

截图:

//截图- (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
0 0