创建一个image
接着创建一个view
UIImage *image = [UIImage imageNamed:@""];
UIImageView *imageview = [[UIImageView alloc]init];
imageview.frame = CGRectMake(0, 0, 222, 333);
imageview.image = image;
[self.view addSubview:imageview];
把图片放到uiimagepngpresentation里面进行数据转换
然后存储,简单的步骤就完成了
UIImage *image = [UIImage imageNamed:@""];
NSData *data = UIImagePNGRepresentation(image);
UIImage *imagepng = [UIImage imageWithData:data];
UIImageWriteToSavedPhotosAlbum(imagepng, nil, nil, nil);
网友评论