Support Forums

Full Version: VB.NET Website Image to PictureBox [SRC]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
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
I will try this Dubstep, thanks for the share.
Not to criticise but you could just save the image and add it as a resource.
But other than that good share.
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.
OMFG. I've been looking for this forever. I coulda used this on some of my programs..
(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 !
Simple but affective. I like it Smile
I know this it is simple as cake Smile.
very nice mate...testing this now.
very nice man ill test it out
Pages: 1 2