代码:RootViewController.h#import <UIKit/UIKit.h>@interface RootViewController : UIViewController@end RootViewController.m- (void)viewD ...
代码:
RootViewController.h
#import <UIKit/UIKit.h>@interface RootViewController : UIViewController@end
- (void)viewDidLoad{ [super viewDidLoad]; // Do any additional setup after loading the view. UIImage * image = [UIImage imageNamed:@"1.jpg"]; NSData * tempData; if (UIImagePNGRepresentation(image)) { tempData = UIImagePNGRepresentation(image); NSLog(@"%@",tempData); } else{ tempData = UIImageJPEGRepresentation(image, 1); } CIImage * iImg = [CIImage imageWithData:tempData]; UIImage * tImg = [UIImage imageWithCIImage:iImg scale:1 orientation:UIImageOrientationRight]; NSLog(@"%@",UIImagePNGRepresentation(tImg)); UIImageView * imageView = [[UIImageView alloc]initWithFrame:CGRectMake(10, 200, 200, 80)]; imageView.image = tImg; [self.view addSubview:imageView]; }
原标题:【代码笔记】图片旋转
关键词:图片
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们:
admin#shaoqun.com
(#换成@)。