|
-
Nov 25th, 2005, 06:09 AM
#1
Thread Starter
New Member
Saving a Webbrowser control image to disk
I'm not a VB programmer but I am attempting a little utility program. My program uses a webbrowser control and retrieves an image from an internet webpage via a direct url. What I want to do is save that image every X minutes to a file on my PC. It's an animated gif (radar image). I would like to save it as a unique name each time, so that I have a running history of all the images (the webpage updates once every hour).
Any ideas out there?
Here is my source (so far) that I hacked from another program (written in VB6)....
Const Flags = 0
Const Target = ""
Const Headers = ""
Dim PostDataSet() As Byte
Private Sub Form_Load()
SendMessage
Me.Show
End Sub
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
'SaveAsFile WebBrowser1.Document
'Unload Me
End Sub
Function SaveAsFile(ByVal htmlPage As HTMLDocument)
'???? how to save the image as a file
End Function
Function SendMessage()
WebBrowser1.RegisterAsBrowser = True
WebBrowser1.Navigate "http://www.landi.ch/meteoftp/radarbild/radar.gif", Flags, Target, PostDataSet, Headers
End Function
-
Nov 25th, 2005, 06:20 AM
#2
Fanatic Member
Re: Saving a Webbrowser control image to disk
Use "Microsoft Internet Transfer Control"
That way, you can do this:
VB Code:
Dim b() as byte
b = Inet1.OpenURL("http://www.landi.ch/meteoftp/radarbild/radar.gif", icByteArray)
Open App.Path & "/radar.gif" for binary access write lock read as #1
Put #1,,b
Close #1
r0ach™
Don't forget to rate the post
-
Nov 25th, 2005, 06:40 AM
#3
Thread Starter
New Member
Re: Saving a Webbrowser control image to disk
 Originally Posted by r0ach
Use "Microsoft Internet Transfer Control"
That way, you can do this:
VB Code:
Dim b() as byte
b = Inet1.OpenURL("http://www.landi.ch/meteoftp/radarbild/radar.gif", icByteArray)
Open App.Path & "/radar.gif" for binary access write lock read as #1
Put #1,,b
Close #1
i try to add this component to my form and it says "license information for this component not found". you do not have appropriate license to use this functionality in design environment". what's up with that?
btw, I am rewriting this program from one written by a friend last year. the URL changed and sadly, i don't have the source. i know it was working with the webbrowser control before - do you know how to simply save the image inthe webbrowser to disk? I'm 90% there - i just need it to save.
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
|