Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

display image from the internet in a PictureBox (C#)

$
0
0

Hi all. Im trying to display images from the web into a picturebox control. when the form loads, i'd like for the pictureBox control to read a URL from a textbox control and load the image. i found the VB equivalent code to do this but im a newbie and cant translate it into C#:

PictureBox1.Image = New System.Drawing.Bitmap(New IO.MemoryStream(New System.Net.WebClient().DownloadData(TextBox1.Text)))  // Assumes there is a textbox called textbox1 and a picturebox called picturebox1 on a form. Textbox1.text should be the URL of the picture.

Is there an easier way to go about this? Any help is appreciated. Thanks in advance

Jason


Viewing all articles
Browse latest Browse all 12583

Trending Articles