Ho creato un rpogrammino che ogni tot di secondi salva delel imamgini dalla webcam.
Precisamente scatta 10 foto dis eguito a distanza di 5 secondi (tempo modificbile a mio piacimento).
Il programam funziona correttamente,a patto che non venga ridotto ad icona, in tal caso le immagini scattate sono tutte uguali, e' come se quando fosse ridotto ad icona non venisse aggiornata la picture box con i dati in entrata dalla webcam.
Avete qualche idea di cosa possa essere?
Il codice con cui inserisco nelal picturebox l'immagine prveniente dalla webcam e' questo:
Spero in un vostro aiutocodice:Private Sub OpenPreviewWindow() ' Open Preview window in picturebox hHwnd = capCreateCaptureWindowA(iDevice, WS_VISIBLE Or WS_CHILD, 0, 0, 640, 480, picCapture.hwnd, 0) ' Connect to device If SendMessage(hHwnd, WM_CAP_DRIVER_CONNECT, iDevice, 0) Then 'Set the preview scale SendMessage hHwnd, WM_CAP_SET_SCALE, True, 0 'Set the preview rate in milliseconds SendMessage hHwnd, WM_CAP_SET_PREVIEWRATE, 66, 0 'Start previewing the image from the camera SendMessage hHwnd, WM_CAP_SET_PREVIEW, True, 0 ' Resize window to fit in picturebox SetWindowPos hHwnd, HWND_BOTTOM, 0, 0, picCapture.ScaleWidth, picCapture.ScaleHeight, SWP_NOMOVE Or SWP_NOZORDER cmdSave.Enabled = True cmdStop.Enabled = False Else ' Error connecting to device close window DestroyWindow hHwnd cmdSave.Enabled = False End If End Sub
ciao a tutti

Rispondi quotando
