title: How Do I Show Image Loading Progress in progress-bar c#
body: <p>I want to know how to show image loading progress in progress-bar in win form.</p>
  
  <p>my code is</p>
  
  <pre><code>private void Form2_Load(object sender, EventArgs e)//load form and get profile and avatar
      {
          backgroundWorker1.ProgressChanged += new ProgressChangedEventHandler(backgroundWorker1_ProgressChanged);
          backgroundWorker1.RunWorkerCompleted += new RunWorkerCompletedEventHandler(backgroundWorker1_RunWorkerCompleted);
          backgroundWorker1.RunWorkerAsync();
      }
  
  
    private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
      {
          label2.Text = "Avatar Loaded"; 
      }
  
  
  
  
  private void backgroundWorker1_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e)//showing progress
      {
          if (InvokeRequired)
          {
              BeginInvoke(new Action(() =&gt; backgroundWorker1_ProgressChanged(sender, e)));
          }
          else
          {
              if (progressBarX1.Value != e.ProgressPercentage)
              {
                  progressBarX1.Value = e.ProgressPercentage;
                  progressBarX1.Refresh();
              }
          }
      }
  
   private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)//loading avatar
      {
          WebClient wc = new WebClient();
          Stream stream = wc.OpenRead("http://avatar.nimbuzz.com/getAvatar?jid=" + textBox1.Text);
          pictureBox1.Image = (Image.FromStream(stream));
      }
  </code></pre>
  
  <p>The image loads successfully but do not show any progress in progress-bar</p>