how do i go to a specified URL, grab a png image, and drop it onto my windows form in my vb.net windows application?
+1
A:
You could simply put a WebBrowser control on your windows form and point it to the specified URL.
fretje
2009-06-07 18:48:12
+1
A:
I would put a picture control on the form then download the picture into a Picture object using HttpWebRequest. Then set the .picture attribute of the picture control box. I would write the code to do it but I'm a bit rusty with .net stuff.
Codygman
2010-08-20 07:35:00
+2
A:
Use a picture box as suggested before. But i would suggest you to use the WebClient-Class:
WebClient wc = new WebClient();
wc.DownloadFile("URL goes here", "Local file path goes here");
There is also a "DownloadFileAsync" method with events.
Update: The PictureBox class supports direct download via:
pictureBox.Load("http://yourdomain.net/Image.jpg");
Scordo
2010-08-20 07:40:24
...and how would you display it on the form?
Kieren Johnstone
2010-08-20 07:57:16
As stated above. Use the PictureBox. You can load a local image into the PictureBox by calling pictureBox1.Load(@"C:\Image.jpg") for example. BTW. You can also provide an url so the step of downloading the image first is not necessarily needed. Sample: pictureBox1.Load("http://www.cwcity.de/community/group/pics/view/165_grp_vw.jpg");
Scordo
2010-08-20 09:05:38