The AddressBook framework provides ABPersonCopyImageData for getting the contact image for each address book entry. This is great for the image data, but the user also sizes and crops the image for framing purposes. When I get the image data, I get the full image, and not the cropped image. How do I get the frame the user used to crop the image (or in lieu of that, how do I get access to the cropped image/data)?
iOS 4.1 adds a new method: ABPersonCopyImageDataWithFormat
in ABPerson
.
I'm using it like this:
NSData *imageData = [(NSData *)ABPersonCopyImageDataWithFormat(recordRef, kABPersonImageFormatThumbnail) autorelease];
The formats allowed are:
kABPersonImageFormatThumbnail
kABPersonImageFormatOriginalSize
This allows you to get the original image or the cropped image (thumbnail).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With