Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to capture and save image into HD by webcam

Status
Not open for further replies.

dandalina

Programmer
May 12, 2003
4
ID
Hi, I have a problem coding that I have to capture and save image and named the file by date into HD.
pls help me
thanks
 

Check out this thread708-428674. The person there was capturing frames from an AVI. The code I posted should help you capture the picture you are seeking.

Good Luck

 
Hi, Thank you very much. I'll check it out.
But I have the problem, that the webcam that plug to the server is several, such cam1, cam2, cam3. so I thought the solution that we make ip address on the cam. Can u help me, pls.......
 

Well if you are displaying what the camera sees on the screen then the code I pointed you to will take a handle to a window and capture just that part.

Good Luck

 

Ok, here is a simple capture of a picture box playing an avi with the use of a MMC (Microsoft Multimedia Control). What you need to do is... take the code in the other thread708-428674 and place it in a module of a new project. Add a command button (Command1) a picture box (Picture1) and a Microsoft Multimedia Control (MMControl1) to form1 and cut and paste the following code into form1...
[tt]
Option Explicit

Dim Cnt As Integer
Dim BasePath As String

Private Sub Form_Load()
BasePath = "Enter your path here"
End Sub

Private Sub Command1_Click()

MMControl1.Notify = True
MMControl1.Wait = True
MMControl1.Shareable = False
MMControl1.DeviceType = "AVIVideo"
MMControl1.FileName = "C:\Program Files\Microsoft Visual Studio\Common\Graphics\Videos\FileCopy.avi"
'or where ever you have an avi
MMControl1.hWndDisplay = Picture1.hWnd
MMControl1.Command = "Open"
MMControl1.Command = "Step"
MMControl1.Frames = 1

End Sub

Private Sub MMControl1_Done(NotifyCode As Integer)

SavePicture CaptureWindow(Picture1.hWnd, False, 0, 0, Picture1.ScaleWidth, Picture1.ScaleHeight), BasePath & Cnt & ".bmp"
Cnt = Cnt + 1
MMControl1.Notify = True
MMControl1.Command = "Step"
MMControl1.Frames = 1

End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
MMControl1.Command = "Close"
End Sub
[/tt]

I hope this helps, Good Luck

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top