How do I get the cropping frame of the address book image data?

后端 未结 3 1156
既然无缘
既然无缘 2021-02-08 17:21

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 an

3条回答
  •  不知归路
    2021-02-08 17:57

    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).

提交回复
热议问题