首页 > 其他 > 详细

ALAsset是什么?

时间:2014-04-01 16:49:47      阅读:554      评论:0      收藏:0      [点我收藏+]

最近有工作要推荐,iOS工程师,要找工作的同学加微信公众账号:iOSDevTip

bubuko.com,布布扣



获得的ALAsset对象就是相片对象:其中有相片的缩略图,全屏图,高清图,url等属性。

ALAsset *result = [assets objectAtIndex:index];

获取url:

String类型:

NSString *url = [[[result

defaultRepresentation]url]description];

URL类型:

NSURL *url = [[result defaultRepresentation]url];

获取缩略图:

CGImageRef  ref = [result thumbnail];

UIImage *img = [[UIImage alloc]initWithCGImage:ref];

获取全屏相片:

CGImageRef ref = [[result  defaultRepresentation]fullScreenImage];

UIImage *img = [[UIImage alloc]initWithCGImage:ref];

获取高清相片:

CGImageRef ref = [[result  defaultRepresentation]fullResolutionImage];

UIImage *img = [[UIImage alloc]initWithCGImage:ref];

ALAsset是什么?,布布扣,bubuko.com

ALAsset是什么?

原文:http://blog.csdn.net/iosdevtip/article/details/22723267

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!