簡體   English   中英

如何從fbprofilepictureview檢索圖像並將該圖像存儲到數據庫中

[英]How to retrieve an image from fbprofilepictureview and store this image into database

顯示個人資料圖片。

      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

     UIImage *img_Profile = --------.imageView.image; // How to get that image view 
     NSData *dataOfProfilePic = UIImagePNGRepresentation(img_Profile);

https://graph.facebook.com/username/picture?redirect=true

使用此網址,您可以獲得個人資料照片。

在Facebook代表loginViewFetchedUserInfo您可以獲取用戶個人資料圖片的圖片網址

 - (void)loginViewFetchedUserInfo:(FBLoginView *)loginView
                            user:(id<FBGraphUser>)user 
{

NSString *imageUrl=[NSString stringWithFormat:@"https://graph.facebook.com/%@/picture?redirect=true", user.username];

}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM