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?
Re: Show picture on form from current web browser.
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?
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.
Re: Show picture on form from current web browser.
Quote:
Originally Posted by
sapator
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'.
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 ?
Re: Show picture on form from current web browser.
Quote:
Originally Posted by
sapator
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.
Re: Show picture on form from current web browser.
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. :(
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. =/