J.C.Morris
J.C.Morris

Reputation: 803

How to save a picture from a webcam to a file on the C drive

My application is extremely simple and to the point. When I click a button, it will go to an indicated IP address of a particular camera and either stream video from the IP address in iexplore, or save whatever image is currently on the camera depending if user chooses stream or static mode.

What I am having trouble with is going to a camera in still mode and saving the file to a folder/file in my C:// drive.

*The only difference between still mode and stream mode is I attach '/image' to the end of the IP address when I just want a static image. If I open the IP address just by itself it will stream the video (which is working fine).

The following code shows what I have so far, which is opening the IP address in both stream and still mode, as indicated.

I am using the ShellEx module.

 Private Sub DS_Stream_Click()   // Cam 1 video stream
 ShellEx "http://999.999.999.100", vbNormalFocus
 End Sub

 Private Sub OS_Stream_Click() // Cam 2 video stream
 ShellEx "http://999.999.999.101", vbNormalFocus
 End Sub

 Private Sub Update_Btn_Click(idx As Integer) // Cam 1 still pic
 ShellEx "http://999.999.999.100/image", vbNormalFocus
 End Sub

 Private Sub ExecLink(Url As String, style As VbAppWinStyle)
 ShellEx "iexplore.exe "
 End Sub

So how can I go to 'Cam 1 still pic' IP address and save that image to my C drive somewhere( like a folder so I can go back and view all the still shots whenever I need to)?

I then plan on opening that image in a picture box on my form (so it scales down properly and retains clarity). The image shown will be the latest picture saved to my folder on the C drive.

Any thoughts?

Upvotes: 1

Views: 492

Answers (1)

barnameha
barnameha

Reputation: 375

maybe u need use of api code to download from link such az a urldownload or inet control and another ways , maybe u need use of activex control for take picture from webcam by ip or without ip using and in win7 or higher you need access permission to create file (run as administrator)

Upvotes: 1

Related Questions