Here's a sample VB.NET 2003 project I made that shows how to capture snapshots from a webcam using WIA (Windows Image Acquisition). It detects the available device (tested with a Logitec Webcam), and allows you to grab an image. Being that it is a WIA Sample project, you have to use a WIA enabled device (usually if the device shows up in "Scanners & Cameras" in control panel, it should be WIA enabled).
The ability to use WIA, you first need to have the WIA Automation Layer, provided in "wiaaut.dll", registered. If you need this, you can download it from Microsoft here: http://www.microsoft.com/downloads/d...DisplayLang=en
You then need to add a reference to the dll if you wish to use it in a project of yours. It should already be done so in the sample project download at the end.
***Note - WIA 2.0 is only supported in Windows XP SP1 or later.
Sample project code for the procedure to get the available devices (see full code in zip file):
VB Code:
Private Sub GetDevice()
Dim MyDevice As WIA.Device
Dim MyDialog As New WIA.CommonDialogClass
Try
'shows selectdevice dialog, if only one device, It automatically selects the device
'(not tested with two or more devices)
'**Note - Device Type checks for VideoDeviceType, for webcams, in this sample