|
-
Aug 13th, 2010, 02:12 AM
#1
Thread Starter
New Member
Displaying Image From WebBrowser Onto PictureBox
I'm trying to do this : http://www.vbforums.com/showthread.php?p=3754316
But using VB.Net instead of VB6.
I run into a problem with WebBrowser1.Document.Body.createcontrolrange()
Thanks for the help.
-
Aug 14th, 2010, 04:50 PM
#2
Thread Starter
New Member
Re: Displaying Image From WebBrowser Onto PictureBox
-
Aug 16th, 2010, 02:38 AM
#3
Thread Starter
New Member
Re: Displaying Image From WebBrowser Onto PictureBox
-
Aug 16th, 2010, 03:35 AM
#4
PowerPoster
Re: Displaying Image From WebBrowser Onto PictureBox
what code have you currently got?
hint:
you need to obtain the image path and use a Stream to read it and then read from stream using the Image class, finally setting the Picturebox Image property to that image object.
-
Aug 16th, 2010, 03:47 AM
#5
PowerPoster
Re: Displaying Image From WebBrowser Onto PictureBox
Be sure to import the System.IO namespace and System.Net namespace
C#:
Code:
WebRequest r = WebRequest.Create("http://websitehere.com/picture.jpg");
HttpWebResponse response = (HttpWebResponse)r.GetResponse();
Stream st = response.GetResponseStream();
this.pictureBox1.Image = Image.FromStream(st);
VB.NET:
Code:
Dim request As WebRequest = WebRequest.Create("http://websitehere.com/myimage.jpg")
Dim response As HttpWebResponse = CType(request.GetResponse(), HttpWebResponse)
Dim st As Stream = response.GetResponseStream()
Me.PictureBox1.Image = Image.FromStream(st)
-
Aug 16th, 2010, 01:10 PM
#6
Thread Starter
New Member
Re: Displaying Image From WebBrowser Onto PictureBox
I have already tried using WebRequest but I can't use that method because the image expires after it is already viewed once(On WebBrowser) so I need to extract it directly from whats already loaded. Thanks.
-
Aug 16th, 2010, 01:18 PM
#7
PowerPoster
Re: Displaying Image From WebBrowser Onto PictureBox
i dont understand what you mean by the image expires already? Care to elaborate?
-
Aug 16th, 2010, 01:55 PM
#8
Thread Starter
New Member
Re: Displaying Image From WebBrowser Onto PictureBox
Basically the image is a Captcha, after it loads the first time anytime you try to load it again, it displays Captcha Expired.
-
Aug 16th, 2010, 03:11 PM
#9
PowerPoster
Re: Displaying Image From WebBrowser Onto PictureBox
well of course it will with such things. i dont think its possible to do what you are trying to do. is there a reason you are doing what you are doing?
-
Aug 17th, 2010, 09:28 AM
#10
Thread Starter
New Member
Re: Displaying Image From WebBrowser Onto PictureBox
Well it's possible here : http://www.vbforums.com/showthread.php?p=3754316 but it's for VB6, I'm wondering how to use that method in .NET
-
Aug 17th, 2010, 09:35 AM
#11
PowerPoster
Re: Displaying Image From WebBrowser Onto PictureBox
but not for the captcha be it if you use VB6 or not.
in the link, all they are doing is getting hold of the image, doing a clipboard copy, and pasting it into the picturebox.
-
Aug 17th, 2010, 11:57 AM
#12
Re: Displaying Image From WebBrowser Onto PictureBox
Sounds to me that he/she is trying to create some kind of spam-tool... Am I correct?
-
Aug 17th, 2010, 11:58 AM
#13
PowerPoster
Re: Displaying Image From WebBrowser Onto PictureBox
who knows but captcha was developed specifically for a purpose
-
Aug 17th, 2010, 11:59 AM
#14
Re: Displaying Image From WebBrowser Onto PictureBox
hehehe.
-
Aug 17th, 2010, 06:25 PM
#15
Thread Starter
New Member
Re: Displaying Image From WebBrowser Onto PictureBox
 Originally Posted by Techno
but not for the captcha  be it if you use VB6 or not.
in the link, all they are doing is getting hold of the image, doing a clipboard copy, and pasting it into the picturebox.
Yeah, that is exactly what I need to do. They can copy it because it is already loaded. Copying does not require the captcha to be loaded again. And I guess you can call it a spam-tool if you want, but it's not in that sense. More of a..automated form submitter.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|