本文介绍了如何从fbprofilepictureview检索图像并将此图像存储到数据库中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
显示个人资料图片。
self.userProfileImage.profileID = user.id;
但是
for (NSObject *obj in [userProfileImage subviews]) {
if ([obj isMemberOfClass:[UIImageView class]]) {
UIImageView *objImg = (UIImageView *)obj;
img_ProfilePictureImg.image = objImg.image;
break;
}
}
img_ProfilePictureImg.image=[UIImage imageWithContentsOfFile:profileImage];
我没有得到--- fbprofilepicture
i didn't get ---fbprofilepicture
UIImage *img_Profile = --------.imageView.image; // How to get that image view
NSData *dataOfProfilePic = UIImagePNGRepresentation(img_Profile);
推荐答案
https:// graph .facebook.com / username / picture?redirect = true
使用此网址即可获得个人资料照片。
Using this url you can get profile pic.
在Facebook委托 loginViewFetchedUserInfo
您可以获取用户个人资料图片的图片网址
In Facebook Delegate loginViewFetchedUserInfo
you can get the image url of User Profile pic
- (void)loginViewFetchedUserInfo:(FBLoginView *)loginView
user:(id<FBGraphUser>)user
{
NSString *imageUrl=[NSString stringWithFormat:@"https://graph.facebook.com/%@/picture?redirect=true", user.username];
}
这篇关于如何从fbprofilepictureview检索图像并将此图像存储到数据库中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!