【发布时间】:2010-10-08 10:33:17
【问题描述】:
我正在从通讯录中获取联系人列表,其中一些联系人的图像是用相机拍摄的,它们的尺寸非常大。我正在以 3x3 行和列的格式显示联系人及其图像。问题是由于图像尺寸巨大,加载图像需要时间。谁能建议我如何压缩它们。 我尝试以某种方式压缩它们:
if ([imageData length] > 0)
{
int len = [imageData length];
if(len > 9000)
{
UIImage *theImage = [UIImage imageWithData:imageData];
imageData = UIImageJPEGRepresentation(theImage,0.5);
printf("\n image data length in condition...%d",[imageData length]);
imageViewL.image = [UIImage imageWithData:imageData];
}
else
{
imageViewL.image = [UIImage imageWithData:imageData];
}
}
尽管加载需要时间。
任何人的帮助将不胜感激。
谢谢大家, 莫尼什。
【问题讨论】:
标签: objective-c