开发者

How does ABPersonViewController work for processing photo data?

开发者 https://www.devze.com 2023-01-07 16:23 出处:网络
Through ABPersonViewController we can edit contact\'s photo. Then How can we access the photo info by other way? However, we got ABPerson\'s image data as the big original picture but not the clip pho

Through ABPersonViewController we can edit contact's photo. Then How can we access the photo info by other way? However, we got ABPerson's image data as the big original picture but not the clip photo data as the ABPersonViewControll开发者_StackOverflow中文版er show. Then what should we do? ABPersonCopyImageData, next?


+[UIImage imageWithData:]

To scale the image, something like

UIGraphicsBeginImageContextWithOptions(size, YES, 0);
[[UIImage imageWithData:data] drawInRect:(CGRect){{0,0},size}];
UIImage * scaledImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();

(assuming size is the number of "points", for iPhone 4 support)

0

精彩评论

暂无评论...
验证码 换一张
取 消