Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 207
  • Last Modified:

jpg from url

Hello vb coders,
I am trying to make some code that can show me a jpg picture from an url.

The thing is, I am trying to store data from a camera connected to the LAN. The camara is connected through a video server. A web page updates pictures every second and I would like to store these pictures to the HD.

I saw an example on MSDN with pictureFromUrl, but this does not work as I would like it to work. The example requires to make an OCX. Is it possible to do this without making an OCX? Secondly, the example does not update at all. It only gives me the first picture that the camara sent.

Please help

best regards
ismohamed
0
ismohamed
Asked:
ismohamed
1 Solution
 
AzraSoundCommented:
You can use the URLDownloadToFile API to save the image to disk, and then use LoadPicture to show it in a PictureBox, e.g.,


Private Declare Function URLDownloadToFile Lib "urlmon" _
   Alias "URLDownloadToFileA" _
  (ByVal pCaller As Long, _
   ByVal szURL As String, _
   ByVal szFileName As String, _
   ByVal dwReserved As Long, _
   ByVal lpfnCB As Long) As Long




Function DownloadAndDisplayImage(ByVal URL As String)
    Call URLDownloadToFile(0&, URL, App.Path & "\temp.jpg", 0&, 0&)
    Picture1.Picture = LoadPicture(App.Path & "\temp.jpg")
End Function
0
 
ismohamedAuthor Commented:
Hi Azrasound,

You are on the right track. It is something similar I am looking for.  But the given example works the same way as my own example! The thing is, I am trying to stream video data. The website contains a jpg that is updated every second. I only get the first jpg. If I go to my internet explorer and "refresh" the site, then I can download the next picture. I would like to be able to do this without me having to push the refresh button in internet explorer, since I am tring to stream video data. Maybe someone has some code that can help me in streaming video pictures??

best regards
ismohamed
0
 
CleanupPingCommented:
ismohamed:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Experts: Post your closing recommendations!  Who deserves points here?
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
AzraSoundCommented:
Recommendation - PAQ - Refund points
0
 
ismohamedAuthor Commented:
refund
0
 
ismohamedAuthor Commented:
refund
0
 
DanRollinsCommented:
ismohamed, an EE Moderator will handle this for you.
Moderator, my recommended disposition is:

    Refund points and save as a 0-pt PAQ.

DanRollins -- EE database cleanup volunteer
0
 
Computer101Commented:
PAQed, with points refunded (100)

Computer101
E-E Admin
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now