Results 1 to 4 of 4

Thread: Copy image from webbrowser

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2011
    Posts
    31

    Copy image from webbrowser

    This seem to work in vb6 but no longer in vb.net

    Dim O As Object

    Set O = WebBrowser1.Document.body.createControlRange()
    Call O.Add(WebBrowser1.Document.All("imgcode"))
    Call O.execCommand("Copy")

    Set Picture1.Picture = Clipboard.GetData


    Anyone can help?

  2. #2
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: Copy image from webbrowser

    What? VB6 code doesn't work in VB.Net? Gee, who'd have thunk it? There are more examples of webpage manipulation in the Codebank than you can shake a Firefox programmer at so take a look.
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

  3. #3
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Posts
    12,380

    Re: Copy image from webbrowser

    Here's a codebank post from one of our Moderators. It actually shows a couple of different ways later on down the thread.
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | HtmlLessons | CssLessons | Code Tags | Sword of Fury - Jameram

  4. #4
    New Member
    Join Date
    May 2013
    Posts
    1

    Re: Copy image from webbrowser

    Dim N As Object
    N = web1.Document.DomDocument.body.createControlRange()
    N.Add(web1.Document.Images(0).DomElement)
    N.execCommand("Copy")
    pic1.Image = My.Computer.Clipboard.GetImage()

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width