andyburrow
Programmer
Hey Guys,
I need some help on the 'Dim lpszName As Char (100)' line and the 'MyNumber = Convert.ToInt32(lpszName)' line.
It comes up saying MyNumber not defined; fine, so I Dim MyNumber, say as an Integer or a Char, and then it says 'Value is not a member of...'; on the CapGetDriver line.
Can someone help? I'm pulling my hair out here.
I've copied in the entire Sub at the bottom.
Cheers
Andy
Sub MapWebcamToWindow(ByRef lWidth As Integer, ByRef lHeight As Integer, ByRef hWnd As Integer)
>>> Dim lpszName As Char(100)
>>> MyNumber = Convert.ToInt32(lpszName)
Dim bmp As BITMAPINFO
With bmp.bmiHeader
.biSize = Len(bmp.bmiHeader)
.biWidth = 320
.biHeight = 240
.biPlanes = 1
.biBitCount = 24
End With
>>> capGetDriverDescriptionA(0, MyNumber.Value, 100, Nothing, 100)
lwndC = capCreateCaptureWindowA(MyNumber.Value, _
WS_VISIBLE Or WS_CHILD, 0, 0, lWidth, lHeight, hWnd, 0)
If capDriverConnect(lwndC, 0) Then
capPreviewRate(lwndC, 66)
capPreview(lwndC, True)
capSetVideoFormat(lwndC, bmp, Len(bmp))
SetWindowPos(lwndC, 0, 0, 0, bmp.bmiHeader.biWidth, _
bmp.bmiHeader.biHeight, SWP_NOMOVE Or SWP_NOZORDER)
End If
End Sub
Sub CloseWebcam()
capDriverDisconnect(lwndC)
End Sub
End Module
I need some help on the 'Dim lpszName As Char (100)' line and the 'MyNumber = Convert.ToInt32(lpszName)' line.
It comes up saying MyNumber not defined; fine, so I Dim MyNumber, say as an Integer or a Char, and then it says 'Value is not a member of...'; on the CapGetDriver line.
Can someone help? I'm pulling my hair out here.
I've copied in the entire Sub at the bottom.
Cheers
Andy
Sub MapWebcamToWindow(ByRef lWidth As Integer, ByRef lHeight As Integer, ByRef hWnd As Integer)
>>> Dim lpszName As Char(100)
>>> MyNumber = Convert.ToInt32(lpszName)
Dim bmp As BITMAPINFO
With bmp.bmiHeader
.biSize = Len(bmp.bmiHeader)
.biWidth = 320
.biHeight = 240
.biPlanes = 1
.biBitCount = 24
End With
>>> capGetDriverDescriptionA(0, MyNumber.Value, 100, Nothing, 100)
lwndC = capCreateCaptureWindowA(MyNumber.Value, _
WS_VISIBLE Or WS_CHILD, 0, 0, lWidth, lHeight, hWnd, 0)
If capDriverConnect(lwndC, 0) Then
capPreviewRate(lwndC, 66)
capPreview(lwndC, True)
capSetVideoFormat(lwndC, bmp, Len(bmp))
SetWindowPos(lwndC, 0, 0, 0, bmp.bmiHeader.biWidth, _
bmp.bmiHeader.biHeight, SWP_NOMOVE Or SWP_NOZORDER)
End If
End Sub
Sub CloseWebcam()
capDriverDisconnect(lwndC)
End Sub
End Module