Results 1 to 10 of 10

Thread: Show picture on form from current web browser.

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2009
    Posts
    79

    Show picture on form from current web browser.

    Hi, I have a form with a web browser on it.

    The web browser has a captcha on it.

    I want the captcha to be shown on the form iteself.

    Maybe in a picturebox or something. But it needs to be the current picture on the web browser.

    I have looked around and I couldn't find anything that could achieve this.

    Help would be much appreciated! Thanks.

    EDIT:

    The captcha is on this website: http://passport.nexon.net/Registrati...eme=Maplestory

    EDIT:

    Or if this is possible, could I add the image "captchaSF_Image" to the clipboard and then paste it in the picturebox1.image? If so how could this be done?
    Last edited by WookieVagina; Mar 26th, 2010 at 11:20 PM.

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Mar 2009
    Posts
    79

    Re: Show picture on form from current web browser.

    halp?

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Mar 2009
    Posts
    79

    Re: Show picture on form from current web browser.

    Okay, so this is what I tried.

    Code:
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    
            Dim O As Object
            O = WebBrowser1.Document.Body.createControlRange()
            Call O.Add(WebBrowser1.Document.All("captchaSF_Image"))
            Call O.execCommand("Copy")
            PictureBox1.Image = Clipboard.GetImage
        End Sub
    But, "createControlRange" is not a member of "Systems.Windows.Forms.HtmlElement"

    does anybody know how to fix this?

    EDIT:

    I also tried:

    Code:
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            WebBrowser1.Navigate("http://passport.nexon.net/Registration/Signup.aspx?nexonTheme=Maplestory")
    
            Dim O As Object
            O = WebBrowser1.Document.Body.GetElementsByTagName("captchaSF_Image")
            Call O.execCommand("Copy")
            PictureBox1.Image = Clipboard.GetImage
        End Sub
    but i got
    "Object reference not set to an instance of an object."

    is this because the web browser didnt finish navigating to the defined url?
    Last edited by WookieVagina; Mar 26th, 2010 at 11:51 PM.

  4. #4
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    Re: Show picture on form from current web browser.

    Hi.
    Not in a VS machine but have you tried to pass the image directly in to the picturebox?
    something like PictureBox1.Image = WebBrowser1.Document.Body.GetElementsByTagName("captchaSF_Image")

    Also i haven't played with the WebBrowser control but i assume that you must provide what exactly you want from the GetElementsByTagName.
    Does it have .GetElementsByTagName("captchaSF_Image").ToByteArray ?
    Sorry i cannot try anything cuz as i've said i don't have vs intalled here.
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Mar 2009
    Posts
    79

    Re: Show picture on form from current web browser.

    Quote Originally Posted by sapator View Post
    Hi.
    Not in a VS machine but have you tried to pass the image directly in to the picturebox?
    something like PictureBox1.Image = WebBrowser1.Document.Body.GetElementsByTagName("captchaSF_Image")

    Also i haven't played with the WebBrowser control but i assume that you must provide what exactly you want from the GetElementsByTagName.
    Does it have .GetElementsByTagName("captchaSF_Image").ToByteArray ?
    Sorry i cannot try anything cuz as i've said i don't have vs intalled here.
    Thanks but.. I get this:

    Value of type 'System.Windows.Forms.HtmlElementCollection' cannot be converted to 'System.Drawing.Image'.

  6. #6
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    Re: Show picture on form from current web browser.

    Play a little with the properties of GetElementsByTagName("captchaSF_Image")
    Does it have GetElementsByTagName("captchaSF_Image").Value ?
    GetElementsByTagName("captchaSF_Image").To...Something ?
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Mar 2009
    Posts
    79

    Re: Show picture on form from current web browser.

    Quote Originally Posted by sapator View Post
    Play a little with the properties of GetElementsByTagName("captchaSF_Image")
    Does it have GetElementsByTagName("captchaSF_Image").Value ?
    GetElementsByTagName("captchaSF_Image").To...Something ?
    If I add a . to the end of it the common ones are:

    Count
    GetElementsByName
    GetEnumerator
    Item

    I really don't know what to do to get this to work.

  8. #8
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    Re: Show picture on form from current web browser.

    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  9. #9

    Thread Starter
    Lively Member
    Join Date
    Mar 2009
    Posts
    79

    Re: Show picture on form from current web browser.

    I still don't understand how to show the image from the web browser in a picture box or something on the form.

  10. #10

    Thread Starter
    Lively Member
    Join Date
    Mar 2009
    Posts
    79

    Re: Show picture on form from current web browser.

    Is there a way to download the image to temp files and then show it in the picture box?

    Please help been stuck on this for a LONG time.. Also started writing a new program and it also needs this feature. =/

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