与我之前的问题here相关。从资源库的文件路径将图像加载到UIImage中
我在资产库中的图像的路径,例如:
assets-library://asset/asset.JPG?id=1000000001&ext=JPG
现在,我怎么会从这个路径加载镜像到一个UIImage对象?
下面是代码:
NSString *path = [occasion imagePath];
//temp
NSLog(@"the 2nd occasion imagePath is: %@", path);
//end
if (path != nil)
{
//UIImage *image = [UIImage imageNamed:path];
UIImage *image = [UIImage imageWithContentsOfFile:path];
image = [image imageByScalingAndCroppingForSize:CGSizeMake(36.0, 42.0)];
[[cell imageView] setImage:image];
}