Support Forums
VB.NET Website Image to PictureBox [SRC] - Printable Version

+- Support Forums (https://www.supportforums.net)
+-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87)
+--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18)
+---- Forum: Visual Basic and the .NET Framework (https://www.supportforums.net/forumdisplay.php?fid=19)
+---- Thread: VB.NET Website Image to PictureBox [SRC] (/showthread.php?tid=7252)

Pages: 1 2


VB.NET Website Image to PictureBox [SRC] - Fragma - 05-22-2010

Heres an example of how you can take an image from a website and insert it into a PictureBox on your application.

getimage Function:
Code:
Function getimage(ByVal url As String) As Image
        Using w As New Net.WebClient
            Using s As New IO.MemoryStream(w.DownloadData(url))
                Return Image.FromStream(s).Clone
            End Using
        End Using
End Function

Using the Function: (Under Button_Click)
Code:
PictureBox1.Image = getimage(http://www.IMAGE-URL.com)

Blackhat


RE: VB.NET Website Image to PictureBox [SRC] - Marik™ - 05-24-2010

I will try this Dubstep, thanks for the share.


RE: VB.NET Website Image to PictureBox [SRC] - Matt™ - 05-26-2010

Not to criticise but you could just save the image and add it as a resource.
But other than that good share.


RE: VB.NET Website Image to PictureBox [SRC] - Fragma - 05-26-2010

Yes I am aware you can do that but the above code is helpful for things such as adding certain profile avatars, captcha images, etc... to your form. It can be used for a lot of things which you cannot do otherwise.


RE: VB.NET Website Image to PictureBox [SRC] - Unrated - 05-27-2010

OMFG. I've been looking for this forever. I coulda used this on some of my programs..


RE: VB.NET Website Image to PictureBox [SRC] - Toχic - 06-01-2010

(05-27-2010, 06:29 PM)Unrated Wrote: OMFG. I've been looking for this forever. I coulda used this on some of my programs..

Its very basic you know. Not that hard lol.

But non the less it will come in use !


RE: VB.NET Website Image to PictureBox [SRC] - mmki - 06-06-2010

Simple but affective. I like it Smile


RE: VB.NET Website Image to PictureBox [SRC] - Marik™ - 06-18-2010

I know this it is simple as cake Smile.


RE: VB.NET Website Image to PictureBox [SRC] - NathanE - 12-12-2010

very nice mate...testing this now.


RE: VB.NET Website Image to PictureBox [SRC] - iCookie - 12-12-2010

very nice man ill test it out