How do I connect to a USB webcam in .NET? [closed]

邮差的信 提交于 2019-11-27 00:06:38
Eric Schoonover

You will need to use Windows Image Acquisition (WIA) to integrate a webcam with your application. There are plenty examples of this readily available. Here is a C# Webcam User Control with source.

Here are some more articles and blog posts from people looking to solve the same problem you are:

Interesting side note, WIA isn't supported by Vista for doing Captures from Webcams anymore. They mainly targeted it towards Scanners and pulling stills from cameras.

Also, larger manufacturers like logitech have abandoned WIA is favor of DirectShow.

Here is nice example of doing this. It's using DirectShow.Net (http://directshownet.sourceforge.net/), which is propably better than using "clipboard" :D.

http://www.codeproject.com/KB/audio-video/WebcamUsingDirectShowNET.aspx

Theres a package with functions with a lot of things to do with computer vision systems called AForge. And they have an easy way to get webcam images from a USB camera if you're still looking.

Just check out the sample code for computer vision motion sensor example code. I'm sure you can pull out the function calls you need from it as I did.

[sorry to necro, but this could be of use to someone in the future]

On my computer, WIA was painstakingly sloooow... so i decided to give the Windows Multimedia Video Capture a try.

You can find a demo here.

It really depends on what you want to do. WIA is primarily for capturing stills from imaging devices, and DirectShow (used either through directshow.net or managed DirectX) is for access to fuller video features.

The other option is to create a WPF application. It has a huge amount of built in support for video (to the extent that having a looping video clip as a button is pretty trivial), and should be quick and easy to develop.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!