xanseviera
Junior Member level 3
Hi everyone... im doing camera interfacing with vb6.
this code is for 1 camera setting in VB.. i would like to add few more camera setting...
means, i window in vb can show multiple picture from different camera.
can someone help me?
Screenshot of camera interfacing is been attached below.
this code is for 1 camera setting in VB.. i would like to add few more camera setting...
means, i window in vb can show multiple picture from different camera.
can someone help me?
Code:
Private Sub cmdSettings_Click()
Call SendMessage(hCap, WM_CAP_DLG_VIDEOFORMAT, 0&, 0&)
PicWebCam.BackColor = &HE0E0E0
End Sub
Private Sub cmdGetPicture_Click()
On Error GoTo ErrHandler
Dim sFileName As String
Call SendMessage(hCap, WM_CAP_SET_PREVIEW, CLng(False), 0&)
sFileName = App.Path & "\pic.jpg"
Call SendMessage(hCap, WM_CAP_FILE_SAVEDIB, 0&, ByVal CStr(sFileName))
DoFinally:
Call SendMessage(hCap, WM_CAP_SET_PREVIEW, CLng(True), 0&)
Unload Me
Exit Sub
ErrHandler:
If Err.Number <> 32755 Then
MsgBox Err.Description
End If
Resume DoFinally
End Sub
Private Sub cmdSource_Click()
Call SendMessage(hCap, WM_CAP_DLG_VIDEOSOURCE, 0&, 0&)
End Sub
Private Sub Form_Load()
hCap = capCreateCaptureWindow("Take a Camera Shot", WS_CHILD Or WS_VISIBLE, 0, 0, PicWebCam.Width, PicWebCam.Height, PicWebCam.hWnd, 0)
If hCap <> 0 Then
Call SendMessage(hCap, WM_CAP_DRIVER_CONNECT, 0, 0)
Call SendMessage(hCap, WM_CAP_SET_PREVIEWRATE, 66, 0&)
Call SendMessage(hCap, WM_CAP_SET_PREVIEW, CLng(True), 0&)
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
On Error Resume Next
Call SendMessage(hCap, WM_CAP_DRIVER_DISCONNECT, 0, 0)
If hCap <> 0 Then DestroyWindow (hCap)
Set frmCapPic = Nothing
End Sub
Private Sub PicWebCam_Click()
End Sub
Screenshot of camera interfacing is been attached below.