Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8327301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T01:03:56+00:00 2026-06-09T01:03:56+00:00

Background: I am building a C# Forms application that works with the Facebook API.

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T01:03:57+00:00Added an answer on June 9, 2026 at 1:03 am
    // Download the bitmap data using an instance of WebClient class.
    using (WebClient webClient = new WebClient())
    {
        foreach (var url in urls)
        {
            byte[] bitmapData;
            bitmapData = webClient.DownloadData(url);
    
            // Bitmap data => bitmap => resized bitmap.            
            using (MemoryStream memoryStream = new MemoryStream(bitmapData))
            using (Bitmap bitmap = new Bitmap(memoryStream))
            using (Bitmap resizedBitmap = new Bitmap(bitmap, 50, 50))
            {
                // NOTE:
                // Resized bitmap must be disposed because the imageList.Images.Add() method
                // makes a copy (!) of the source bitmap!
                // For details, see https://stackoverflow.com/questions/9515759/                
                imageList.Images.Add(resizedBitmap);
            }
        }
    }
    

    To increase the timeout of an instance of WebClient class please take a look at this answer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Background: We're building an application that allows our customers to supply data in a
Background: I'm building a small application that will be run daily, pulling data from
I'm currently building a simple application on Gjs , which should change the background-image
I'm building a spotify app that does some work in the background and should
We're building a web app that customers can pay a monthly rate for. Here
Hello and thanks for looking! Background I am building a commercial web application for
I am building an app that can use a user's current location on certain
I am building a WPF application and I want its background to be filled
I'm building an HTTP API which does a heavy site scraping in the background.
Some background I'm currently building a predominantly classic web app (rather than a single

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.