public void LoadImageFromUrl ref string url PictureBox pb HttpWebReque

1
2
3
4
5
6
7
8
9
public void LoadImageFromUrl(ref string url, PictureBox pb)
{
HttpWebRequest request = (HttpWebRequest)Net.HttpWebRequest.Create(url);
HttpWebResponse response = (HttpWebResponse)request.GetResponse;
Image img = Image.FromStream(response.GetResponseStream());
response.Close();
pb.SizeMode = PictureBoxSizeMode.StretchImage;
pb.Image = img;
}