Como con visual basic controlo una web cam

Hyoga1041
12 de Abril del 2006
queri saber como controlar una webcam con visual basic que codigo debo de poner ...

Carlos
12 de Abril del 2006
Existen varios controles que ayudan a controlar la camara, el avicap.dll, presenta problemas de acuerdo al service, y sale un error en memoria, yo utilizo el control de Kodak, imgscan.ocx y el imgedit1.ocx, estos 2 controles permite capturar y ver lo que se ve en la camara, si quiere mas informacion me escribe.

riciar
12 de Abril del 2006
Aqui va un codigo con el que ves la web cam en un picture box.
En tu form debes tener un picture y un commandbuton y acomodar lo siguiente.
Suerte!!!

Const ws_visible = &H10000000
Const ws_child = &H40000000
Const WM_USER = 1024
Const WM_CAP_EDIT_COPY = WM_USER + 30
Const wm_cap_driver_connect = WM_USER + 10
Const wm_cap_set_preview = WM_USER + 50
Const wm_cap_set_overlay = WM_USER + 51
Const WM_CAP_SET_PREVIEWRATE = WM_USER + 52
Const WM_CAP_SEQUENCE = WM_USER + 62
Const WM_CAP_SINGLE_FRAME_OPEN = WM_USER + 70
Const WM_CAP_SINGLE_FRAME_CLOSE = WM_USER + 71
Const WM_CAP_SINGLE_FRAME = WM_USER + 72
Const DRV_USER = &H4000
Const DVM_DIALOG = DRV_USER + 100
Const PREVIEWRATE = 30

Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lparam As Long) As Long
Private Declare Function capCreateCaptureWindow Lib "avicap32.dll" Alias "capCreateCaptureWindowA" (ByVal a As String, ByVal b As Long, ByVal c As Integer, ByVal d As Integer, ByVal e As Integer, ByVal f As Integer, ByVal g As Long, ByVal h As Integer) As Long

Dim hwndc As Long
Private Sub Command1_Click()
'Código que realiza la captura de la imagen:

temp = SendMessage(hwndc, WM_CAP_EDIT_COPY, 1, 0)
Set Picture1.Picture = Clipboard.GetData

End Sub
Private Sub Form_Load()
'Código que activa la captura de imágenesse supone un formulario con 2 picture llamados "picture1" y "picture2")

hwndc = capCreateCaptureWindow("Ventana de Captura", ws_child Or ws_visible, 0, 0, Picture2.Width, Picture2.Height, Picture2.hwnd, 0)
If (hwndc <> 0) Then
temp = SendMessage(hwndc, wm_cap_driver_connect, 0, 0)
temp = SendMessage(hwndc, wm_cap_set_preview, 1, 0)
temp = SendMessage(hwndc, WM_CAP_SET_PREVIEWRATE, PREVIEWRATE, 0)
End If

End Sub