Background: I am building a C# Forms application that works with the Facebook API. My program can already successfully authenticate and retrieve a full list of friend ID's and names. I understand how to add these into a ListView control and this part is successful. This process takes a matter of seconds as my program requests and receives a small JSON file.
With a collection of friends ID's I am then able to get each freinds profile picture from https://graph.facebook.com/USER_ID/picture .
Does anyone have a solution on how I could add these internet sourced images into my ImageList while adding an Image Key so I can link them to a ListViewItem with the User ID ?
private void populate_Click(object sender, EventArgs e)
{
var fb = new FacebookClient(_aT);
dynamic friends = fb.Get("/me/friends");
// Populate the ImageList
ImageList avatars = new ImageList();
foreach (dynamic item in friends.data)
{
var src = "https://graph.facebook.com/" + item.id + "/picture";
// Add Image from src to avatars ImageList
}
}
Please remember that I have a very large set of image to work through. Each Image should be a JPG of 50 x 50 Thanks.