Create a form with a picturebox and command button, then try the following code:
Option Explicit
Private Declare Function GetTempPath Lib "kernel32" _
Alias "GetTempPathA" (ByVal nBufferLength As Long, _
ByVal lpBuffer As String) As Long
Private Declare Function GetTempFileName Lib "kernel32" _
Alias "GetTempFileNameA" (ByVal lpszPath As String, _
ByVal lpPrefixString As String, ByVal wUnique As Long, _
ByVal lpTempFileName As String) As Long
Private Sub Command1_Click()
Picture1.Picture = GetPicFromHTTP("<picture URL that you are interested in>"
End Sub
Private Function GetPicFromHTTP(strURL As String) As StdPicture
Dim strTempPath As String * 512
Dim strTempFileBuff As String * 576
Dim strTempFile As String
Oh, I should point out that the example given assumes that you are dealing with a JPEG image, but is easily adaptable to other formats merely by changing the extension added in the stTemp assigment line.
I caught the jpg gif thing when I was looking at the code. I'll ave to make a slight modification to the code to del with that. I have Added the reffernce to the Miscrosoft Internet Controls to my project but I don't see anything in my tool box for it.
How do I add the control to my project? This looks like it will meet my needs easily.
Thanks for your help. My system has issues so I re-installed VB under a differnt administrators login and everything works beautifully now. Any idea why software installs tell me that I need administrative permissions even though when I look in the user manager I am an Administrator?
Sorry if I was doing a 'teaching grandmother to suck eggs' thing. It's sometimes difficult to tell here the level of knowledge that people come in with.
Frankly, if I was doing this sort of properly I guess I'd parse the extension of the requested file, and therefore make my temporary file follow that. There are still some limitations, as I suspect you know, in what a Picture Box will handle (or, more accurately, what LoadPicture will handle).
Glad the reinstall helped out - but I'm not going to pretend I understand why you currently have an Admin problem...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.