|
-
Dec 5th, 2007, 01:32 PM
#1
Thread Starter
Lively Member
[2005] Display image from axwebbrowser in picture box
i want to display picture from website in a text box. However, this picture already shows up in the browser prior to my wanting to display it in a picturebox. My problem is, i dont want my app to download the image file a second time as many images are very large.
Is there anyway to dynamically grab the reference to the file from the axwebbrowser control's contents?
Currently i have no problem displaying the picture in the picbox using the following code:
vb Code:
Friend Sub ImageDisplayInPictureBox(ByRef myPicturebox As PictureBox, ByVal strUrl As String)
myPicturebox.Image = New System.Drawing.Bitmap(New IO.MemoryStream(New System.Net.WebClient().DownloadData(strUrl)))
End Sub
I would imagine I would need to reference the axwebbrowser controls html doc and somehow find the substring of the picturebox, but how to display data in a seperate container outside of the web browser?
Any help would be appreciated.
-
Dec 5th, 2007, 02:46 PM
#2
Re: [2005] Display image from axwebbrowser in picture box
See this link for code on how to display an image in a picturebox simply by specifying the URL of the image
http://www.vbforums.com/showthread.php?t=387841
You could use the webclient.downloadstring() method to grab the source code of a given URL website, and then parse the image link out of there. However there is no way I know of to intercept the image as the browser loads it and not display it in the browser, but only display it in a picturebox.
I would think the image would be cached in the temporary internet files though, perhaps you could get it that way..
-
Dec 5th, 2007, 06:21 PM
#3
Re: [2005] Display image from axwebbrowser in picture box
It's getting tedious but you could do as kleinma says, then edit the HTML code to remove the image, then load the new HTML into your Web browser.
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
|