NSData *imagedate=UIImagePNGRepresentation(image);//将相片转化成data,当然再这里和主题无关 NSLog(@"%d",imagedate.length);//返回的是字节数 UIImageWriteToSavedPhotosAlbum(image, self, @selector(image:didFinishSavingWithError:contextInfo:), @"liyang");//这个方法的作用是写到相册里面,下面那个是回调方法 - (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo{ NSLog(@"%@",error); NSLog(@"%@",contextInfo); }
ios-UIImage写入相册,布布扣,bubuko.com
原文:http://www.cnblogs.com/liyang31tg/p/3667665.html