ALAsset图像大小 [英] ALAsset Image Size

查看:131
本文介绍了ALAsset图像大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

给定代表照片的ALAsset,是否可以检索照片的大小(高度和宽度),而无需将图像加载到UIImageView中,也不使用aspectRationThumnail方法?


<只需要注意一点:$ b​​ $ b iOS 5.1为ALAssetRepresentation实例引入了一个新的属性维度。这会返回一个具有原始图像尺寸的CGSize结构,并且可能是未来这个问题的最佳解决方案。



干杯,



Hendrik


Given an ALAsset that represents a photo, is it possible to retrieve the size of the photo (height and width) without loading the image into a UIImageView and also without using the aspectRationThumnail method?

解决方案

Just a note: iOS 5.1 introduces a new property dimensions for an ALAssetRepresentation instance. This returns a CGSize structure with the dimensions of the original image and might be the best solution for this problem in the future.

Cheers,

Hendrik

这篇关于ALAsset图像大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆