I am using Visual Basic 2010. Trying to reliably capture webcam images. It works some times - but about 50% of the time it pops up and asks for the video source. Even after this popup it only works sporatically.
Platform Windows 7 32bit, Vusial Basic 2010
Here is a sample of my code - taken from the examples posted on the web.
Private Sub OpenForm()
Try
Dim iHeight As Integer = Privew.Height
Dim iWidth As Integer = Privew.Width
hHwnd = capCreateCaptureWindowA(iDevice, WS_VISIBLE Or WS_CHILD, 0, 0, 640, _
480, Privew.Handle.ToInt32, 0)
If SendMessage(hHwnd, WM_CAP_DRIVER_CONNECT, iDevice, 0) Then
SendMessage(hHwnd, WM_CAP_SET_SCALE, True, 0)
SendMessage(hHwnd, WM_CAP_SET_PREVIEWRATE, 66, 0)
SendMessage(hHwnd, WM_CAP_SET_PREVIEW, True, 0)
SetWindowPos(hHwnd, HWND_BOTTOM, 0, 0, Privew.Width, Privew.Height, _
SWP_NOMOVE Or SWP_NOZORDER)
End If
Catch ex As Exception
End Try
It only works occasionally - many times asking me for the 'Video Source' before it may or maynot show the image.
if any one know help me
Thanx in Advance