#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2013
    Posts
    1
    Rep Power
    0

    Arrow Load A Img From WebBrowser


    When i load a webpage into a Webbrowser and a image is in that WebPage How i can load that Image into a Picturebox in my Form?
    Or How i can save that image in Hard Drive?

    it's important that we don't download again that image!

    (If Any Wrong is in my text please excuse me,my english language isn't very good)
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2011
    Posts
    289
    Rep Power
    45
    There are a couple of different ways. The simplest way utilizes the clipboard. Simply right button click on the image and click copy. You can either use a paste routine to get it where you want it, or put your program into a loop that monitors the clipboard for an image file and load it from the clipboard.

    The second way involves searching through the source code for any image file references. The source is available using:
    WebBrowser.Document.documentElement.innerHTML
    You would still have to identify which image you want, because there could be several. You don't have to worry about it being downloaded again, because if you request it again it is already in cache.

    J.A. Coutts

IMN logo majestic logo threadwatch logo seochat tools logo