从地址簿中获取图片的裁剪版本
我使用以下代码从地址簿加载联系人图片:
- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier{
UIImage *image = [UIImage imageWithData:(NSData *)ABPersonCopyImageData(person)];
return NO;
}
但是,此代码返回存储的完整图像,而不是显示在各个位置(例如地址簿)的裁剪版本。
I load a contacts picture from the address book using the following code:
- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier{
UIImage *image = [UIImage imageWithData:(NSData *)ABPersonCopyImageData(person)];
return NO;
}
However, this code returns the full image that is stored rather than the cropped version, that is shown in various places, like the Addressbook.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在这里找到了答案:https://stackoverflow.com/a/6953492/784318
I found the answer here: https://stackoverflow.com/a/6953492/784318