Load an image from a url into a PictureBox

前端 未结 5 540
旧时难觅i
旧时难觅i 2020-12-05 09:37

I want to load an image into a PictureBox. This is the image I want to load: http://www.gravatar.com/avatar/6810d91caff032b202c50701dd3af745?d=identicon&r=P

5条回答
  •  执念已碎
    2020-12-05 09:51

    If you are trying to load the image at your form_load, it's a better idea to use the code

    pictureBox1.LoadAsync(@"http://google.com/test.png");
    

    not only loading from web but also no lag in your form loading.

提交回复
热议问题