hi guys...
im using the AVICap code to open up a view of a webcam - then setting the parent "window" of the image to on my form - so it appears my application owns the image etc...
Microsoft WDM Image Capture (Win32) < the "Driver" being used to capture the image...
Starting video like this....
vBCode Code:
Dim lpszName As String * 100 Dim lpszVer As String * 100 Dim Caps As CAPDRIVERCAPS '//Create Capture Window capGetDriverDescriptionA 0, lpszName, 100, lpszVer, 100 '// Retrieves driver info lwndC = capCreateCaptureWindowA(lpszName, WS_CHILD Or WS_VISIBLE, 0, 0, 160, 120, lgOwner, 0) '// Connect the capture window to the driver capDriverConnect lwndC, 0 '// Get the capabilities of the capture driver capDriverGetCaps lwndC, VarPtr(Caps), Len(Caps) '// Set the video stream callback function capSetCallbackOnVideoStream lwndC, AddressOf MyVideoStreamCallback capSetCallbackOnFrame lwndC, AddressOf MyFrameCallback '// Set the preview rate in milliseconds capPreviewRate lwndC, 66 '// Start previewing the image from the camera capPreview lwndC, True '// Resize the capture window to show the whole image ResizeCaptureWindow lwndC ' say we are viewing the video bViewVideo = True
and disabling the video like this:
vbcode Code:
'// Disable all callbacks capSetCallbackOnStatus lwndC, vbNull capSetCallbackOnYield lwndC, vbNull capSetCallbackOnFrame lwndC, vbNull capSetCallbackOnVideoStream lwndC, vbNull capSetCallbackOnWaveStream lwndC, vbNull capSetCallbackOnCapControl lwndC, vbNull capSetCallbackOnError lwndC, vbNull DoEvents bViewVideo = False
all working great... EXCEPT:
am i correct in thinking i also need to DESTROY the window that was created using this code...
vbcode Code:
lwndC = capCreateCaptureWindowA(lpszName, WS_CHILD Or WS_VISIBLE, 0, 0, 160, 120, lgOwner, 0)
just got wondering this, since the last visible image from the camera remains on my form, even though the window should of closed? (not a problem, since i hide this control anyway, but would be nice to keep the resources free)
and secondly.. i have two cameras that i can select... - i dont suppose there is a dialogless way to select either camera is there
i have searched the forums and have come to the conclusing the dialog is required, but would be nice just for confirmation of this. Cheers.




Reply With Quote