在ios中,使用ALAsset
,如何提前获取ALAsset
aspectRatioThumbnail
大小(高度和宽度)(而无需将图像加载到某些UIImageview中)。我知道我可以使用Dimensions属性获取完整图像的大小,但是如何为aspectRatioThumbnail
做呢?
最佳答案
您应该使用CGImageGetHeight
和CGImageGetWidth
方法来获取aspectRatioThumbnail
大小,例如:
size_t height = CGImageGetHeight([asset aspectRatioThumbnail]);
size_t width = CGImageGetWidth([asset aspectRatioThumbnail]);
更多信息可用here。