ABContact setImage,缩略图错误?
我已经使用代码设置了地址簿联系人的图像, 它运行良好,当我浏览地址簿时图像就在那里,
但是当来电时,它只显示缩略图?我想显示完整图像而不是缩略图?这是一个错误吗?
NSData *dataRef = UIImageJPEGRepresentation(entry.recIcon,1.0);
CFDataRef cfdata = CFDataCreate(NULL, [dataRef bytes], [dataRef length]);
ABPersonRemoveImageData(person, &error);
ABAddressBookSave(addressBook, &error);
BOOL ret = ABPersonSetImageData(person, cfdata, &error);
if (ret) {
ret = ABAddressBookSave(addressBook, &error);
} else {
NSLog(@"Could not write the image to the person");
}
CFRelease(cfdata);
I have setup addressbook contact's images using a code,
it works well and the image is there when I browse the Addressbook,
But when a call comes, it only shows a thumbnail? I want to show the full image instead the thumbnail? Is it a bug?
NSData *dataRef = UIImageJPEGRepresentation(entry.recIcon,1.0);
CFDataRef cfdata = CFDataCreate(NULL, [dataRef bytes], [dataRef length]);
ABPersonRemoveImageData(person, &error);
ABAddressBookSave(addressBook, &error);
BOOL ret = ABPersonSetImageData(person, cfdata, &error);
if (ret) {
ret = ABAddressBookSave(addressBook, &error);
} else {
NSLog(@"Could not write the image to the person");
}
CFRelease(cfdata);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
找到答案了,
如果替换的图像不够大,Iphone sdk会自动将图像类型保存为缩略图,如果足够大,则在来电时显示完整图像。代码没有任何问题。
Found the answer,
Iphone sdk saves the images type as thumbnail automatically if the image replaced is not big enough, if it is big enough it shows the full image when a call comes. there's nothing wrong with the code.