I’m trying to capture images from a webcam for one application in WPF/C#
1) I tried WIA but i het the error 0x80210015, I have read that this error occurs when there is no WIA device available. I read that in windows vista/7 WPD is used insted WIA but when i try a simple example
PortableDeviceManager deviceManager = new PortableDeviceManager();
deviceManager.RefreshDeviceList();
uint numberOfDevices = 1;
deviceManager.GetDevices(null, ref numberOfDevices);
if (numberOfDevices == 0)
{
Console.WriteLine("No device");
}
else
{
string[] deviceIds = new string[numberOfDevices];
deviceManager.GetDevices(ref deviceIds[0], ref numberOfDevices);
Console.WriteLine(deviceIds);
}
Console.Read();
i cant detect devices.
2) I triead with http://easywebcam.codeplex.com/ works, but i get randomly the error “An error occured while capturing the video image. The video captu…” and i need select the device always and i need execute webcam.start() several times (2 or 3) for that camera works.
I have two webcams
- Chicony Web 2.0 (inbuilt webcam)
- Genius FaceCam 2000
here is a simple take a picture kind of program