Saturday 15 September 2012

c# - Picture box not updating its content -


I try to load the image in there, it does not show anything, just a blank picture box control. This is the code at this time:

  var loadImage = new backgroundwork (); LoadImage.RunWorkerAsync (); // Content that is being executed in the background LoadImage.DoWork + = (O, RGS) => {// Loop through the list of items to find matching pictures. Foreign items (different items in the list) (if (item.Name == name) {try {// get image var request = WebRequest.Create (item.Picture); (Var response = request.GetResponse ()) (Var stream = feedback. Gatesresponsesstream ()) {image image = image.fromstream (stream); Args.Result = image; return;}} hold (exception) {}}}} // // Run it LoadImage.RunWorkerCompleted + = (O, Args) => {PictureBox1.Image = (image) args.Result; Application.DoEvents ();};   

Do something wrong Is it? If so, would you Can I tell me?

As I have commented on your question directly to you, Make a reply, you are running a first background worker to engage your representatives.

Perhaps, you only need to exchange orders in your code .

No comments:

Post a Comment