Oppure

Loading
29/08/08 9:53
super rambo
Salve ragazzi come da titolo mi servirebbe catturare immagini da una webcam e se è possibile salvarle su disco. Come potrei fare?? Grazie!!
aaa
29/08/08 10:14
super rambo
ciao, grazie del link ma non ho capito molto... ci sarebbe qualcosa di più chiaro?? grazie ancora per la disponibilità!!
aaa
29/08/08 10:23
Alceus
Il fatto è che si tratta di un discorso molto difficile e che anche il programmatore più esperto in Visual Basic avrebbe difficoltà ad affrontare. Io ho trovato quel link, ma più di tanto non posso esserti utile, perchè non sono capace di fare una cosa del genere. Comunque prova a googlare un po' e attendi altre risposte. Magari c'è qualcuno nella Community che potrebbe aiutarti... ;)
Ultima modifica effettuata da Alceus 29/08/08 10:25
aaa
29/08/08 10:29
GrG
da quel che ho visto in quel link il primo blocco di codice sono tutte api e costanti e nel secondo tutte funzioni. Tu coia entrambi i blocchi in un modulo e poi nel form devi richiamare la funzione che ti serve.
aaa
29/08/08 10:31
Alceus
Quante funzioni, però...
aaa
29/08/08 10:45
super rambo
credo che rinuncierò perchè non sono molto esperto in vb e non sarei capace di farlo.. cmq se qualcuno sa un codice più facile e lo posta mi farebbe un grande favore!! grazie.
aaa
29/08/08 13:02
Overflow
prova questo codice
Codice quotato da codeproject.com/KB/vb/… :
'This program check whether webcam is available or not
' if available then capture and displays in picture box

'Created by Dixanta Bahadur Shrestha
'Created Date: 12-March-2006

'Programmer does not garuntees if  not functions well

Global Const ws_child As Long = &H40000000
Global Const ws_visible As Long = &H10000000

Global Const WM_USER = 1024
Global Const wm_cap_driver_connect = WM_USER + 10
Global Const wm_cap_set_preview = WM_USER + 50
Global Const WM_CAP_SET_PREVIEWRATE = WM_USER + 52
Global Const WM_CAP_DRIVER_DISCONNECT As Long = WM_USER + 11
Global Const WM_CAP_DLG_VIDEOFORMAT As Long = WM_USER + 41
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
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 hwdc As Long
Dim startcap As Boolean
Private Sub cmdCapture_Click()
Dim temp As Long

  hwdc = capCreateCaptureWindow("Dixanta Vision System", ws_child Or ws_visible, 0, 0, 320, 240, Picture1.hWnd, 0)
  If (hwdc <> 0) Then
    temp = SendMessage(hwdc, wm_cap_driver_connect, 0, 0)
    temp = SendMessage(hwdc, wm_cap_set_preview, 1, 0)
    temp = SendMessage(hwdc, WM_CAP_SET_PREVIEWRATE, 30, 0)
    startcap = True
    Else
    MsgBox ("No Webcam found")
  End If
End Sub

Private Sub cmdClose_Click()
Dim temp As Long
If startcap = True Then
temp = SendMessage(hwdc, WM_CAP_DRIVER_DISCONNECT, 0&, 0&)
startcap = False
End If
End Sub

Private Sub cmdVideoFormat_Click()
 Dim temp As Long
 If startcap = True Then
  temp = SendMessage(hwdc, WM_CAP_DLG_VIDEOFORMAT, 0&, 0&)
End If
End Sub



codeproject.com/KB/vb/…
aaa