【发布时间】:2011-12-26 11:34:30
【问题描述】:
与我之前的问题here有关。
我在资源库中有一张图片的路径,例如:
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];
}
【问题讨论】:
标签: objective-c ios uiimage assets filepath