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 ABPersonViewController show. Then what should we do? ABPersonCopyImageData, next?
A:
+[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)
tc.
2010-07-19 19:04:40
well, [UIImage imageWithData:] got the orignal size of photo, but not the corpping sized photo. What's the matter, because of ios4?
pcjbird
2010-07-20 02:49:44
Crop it yourself? There's code around here somewhere...
tc.
2010-07-20 11:46:21
Maybe, I think there are changes from ios3 to ios4. At or before ios3, we can access the clipped photo, however, since ios4, we can not.
pcjbird
2010-08-05 12:07:53
Do you mean that the image is not scaled, or that it is not cropped? There's a big difference between the two.
tc.
2010-08-06 16:29:34
I mean not cropped. The system image picker maybe can got the crop info, however, since the os4, we can not access the smaller cropped photo image of the contact.
pcjbird
2010-08-07 05:42:57
Sorry, I see what you mean now. It's been asked before in http://stackoverflow.com/questions/3220187/ to which I've added a bounty.
tc.
2010-08-24 14:42:21