NSData与UIImage互相转换

 1.//NSData转换为UIImage
 NSData *imageData = [NSData dataWithContentsOfFile: imagePath];
 UIImage *image = [UIImage imageWithData: imageData];
 
 2.//UIImage转换为NSData
 NSData *imageData = UIImagePNGRepresentation(image);
posted @   柳仙慧子  阅读(6725)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示