Hey guys,

I have a program that downloads a picture from a website and stores it as a stream.
CSharp Code:
  1. public void UpdateGGImagesManager(int GateID, PictureBox pbox)
  2.         {
  3.             Thread a = new Thread(() => UpdateGGImages(GateID, pbox));
  4.             a.IsBackground = true;
  5.             a.Start();
  6.         }
  7.  
  8. public void UpdateGGImages(int GateID, PictureBox pbox)
  9.         {
  10.             try
  11.             {
  12.                     WebRequest request = WebRequest.Create("http://" + server + ".darkorbit.bigpoint.com/jumpgate.php?userID=" + uid + "&gateID=" + GateID + "&type=full");
  13.                     WebResponse webresponse = request.GetResponse();
  14.                     Stream responseStream = webresponse.GetResponseStream();
  15.                     UpdatePictureBox(responseStream, pbox);
  16.             }
  17.             catch (Exception)
  18.             {
  19.             }
  20.         }

Thats the main code. It is then called later like this:
CSharp Code:
  1. ....
  2. case "4":
  3.             {
  4.                        if (root.Element("item").Attribute("duplicate") != null)
  5.                        {
  6.                                output = output + Convert.ToChar(948).ToString() + " gate (Multiplier Received)";
  7.                        }
  8.                        else
  9.                        {
  10.                               output = output + Convert.ToChar(948).ToString() + " gate";
  11.                               ggcomplete[3][0] = Convert.ToInt32(root.Element("item").Attribute("current").Value);
  12.                               UpdateGGImagesManager(4, pictureBox4);
  13.                        }
  14.                        break;
  15.             }
  16. ....


When the thread runs, even though it is running on another thread, the GUI locks up for about a second. This means I can narrow it down to the Invoke on the main thread, meaning that the PictureBox.FromStream method generates a bit of lag??

Is this right or what the heck is goin on?

Thanks,
Josh