Click here to Skip to main content
13,055,047 members (55,671 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


4 bookmarked
Posted 25 Dec 2010

Load an Image from Internet to PictureBox control and Track the Loading Progress

, 5 Jan 2011
Rate this:
Please Sign up or sign in to vote.
How do you load an Image from the internet into a picture box control. How will you track the loading progress
Have a form with a Picture Box control, a Buttton to load the image and a Progress Bar control. Add a Label next to the progress bar to show the % loaded.

The code below loads the Image from internet:
//Image_003: Load the Image from the Internet
private void btnLoadInternet_Click(object sender, EventArgs e)
        if (radNormal.Checked == true)
            pict.WaitOnLoad = false;
        MessageBox.Show("Check that Internet Connection is available");

Now provide the handler for the LoadProgressChanged event of the Picture box control. Unlike load method, the LoadAsync will raise the LoadProgressChanged event when some amount of image bits are downloaded from the http path. Inside the handler, we will use the event argument to decide how much of image is loaded. And the progress bar value is set with the percentage of completion retrieved from the event argument. Also the label control shows the number of percentage.

//Progress_001: Increment the value of the progress bar to show the image
//Load progress
private void pict_LoadProgressChanged(object sender, ProgressChangedEventArgs e)
    progLoadStatus.Value = e.ProgressPercentage;
    lblProgress.Text = e.ProgressPercentage.ToString() + "%";


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Sivaraman Dhamodharan
Software Developer iSOFT
India India
I am working as software engineer in iSOFT R&D. I have been come across C++,MFC, .net technologies. I do like playing video games, reading books.


You may also be interested in...

Comments and Discussions

Generallaveenadeeps, your vote reason and comment is contradicting ... Pin
sirama20043-Jan-11 2:09
membersirama20043-Jan-11 2:09 
GeneralReason for my vote of 1 nice Pin
laveenadeeps28-Dec-10 17:03
memberlaveenadeeps28-Dec-10 17:03 
GeneralThanks Walt and Krish Pin
sirama200428-Dec-10 0:53
membersirama200428-Dec-10 0:53 
GeneralThanks! I wasn't aware of that particular event. Pin
Walt Fair, Jr.27-Dec-10 13:24
subeditorWalt Fair, Jr.27-Dec-10 13:24 
GeneralReason for my vote of 4 Nice event to know on Picture box. Pin
krishnaraj4026-Dec-10 19:12
memberkrishnaraj4026-Dec-10 19:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170713.1 | Last Updated 5 Jan 2011
Article Copyright 2010 by Sivaraman Dhamodharan
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid