How to load Images on a Website to a ImageList
Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
1 post
Page 1 of 1
Im just going to show you how to create a imagelist that contains all the images that is in a website.
You need a WebBrowser named WebBrowser1, and a ImageList named ImageList1
To load the image into the ImageList use this code:
You need a WebBrowser named WebBrowser1, and a ImageList named ImageList1
To load the image into the ImageList use this code:
Code: Select all
Then you can use this imagelist with your listview For Each Image As HtmlElement In WebBrowser1.Document.Images
Dim URL As String = Image.GetAttribute("src") 'Gets the URL of the image
Try
Dim NewImage As Image
Dim ImageStream As Stream
Dim Request As HttpWebRequest
Dim Response As HttpWebResponse
Request = HttpWebRequest.Create(URL) 'Creates a Request for the image
Response = Request.GetResponse() 'Gets the response
ImageStream = Response.GetResponseStream() 'Reads the response
NewImage = System.Drawing.Image.FromStream(ImageStream) 'Creates a image from the response
ImageList1.Images.Add(NewImage) 'Adds the image to the imagelist
Catch ex As Exception
MsgBox("Failed to add the image from the url """ & URL & """.")
End Try
Next
LMAOSHMSFOAIDMT
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!
![Image]()
![Image]()
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!

1 post
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023