I want to load an image into a PictureBox from a URL at runtime. Any ideas how?
I was attempting to do it like thisbut it told me that the cast (data type?) of the responsestream and image objects didn't match. I also tried usingCode:' Get image Dim oXMLHTTP As New MSXML2.XMLHTTP() oXMLHTTP.open("GET", "http://www.site.com/image.jpg") oXMLHTTP.send() Dim strImage As System.IO.Stream = oXMLHTTP.responseStream oXMLHTTP = Nothing ' Load image into Picture Box picProductImage.Image = Image.FromStream(strImage)Only to be told that the FromFile method didn't support URLs.Code:picProductImage.Image = Image.FromFile("http://www.site.com/image.jpg")
So I'm stuck.




Reply With Quote