问题
Having searched high and low for native c# hook to webcam, I found 5 basic ways to interact with the camera.
- Video for Windows (VFW)
- DirectX
avicap32.dll
- WIA
- 3rd party tools
My requirement is to take a photo. The application will be used on some legacy windows XP and Vista machines, but going forward Windows 7 and greater will be required. So what might the best approach be with the broad install base? Just reading WIA looked like the way to go but looks like some changes were made so it works a little different now (I don't know for sure). I understand that some people have done combos.
Might need to crop photo, but that is really about it.
For school visitor monitoring.
回答1:
I think the best thing is to use the WIA. I know a third party toolkit that could help you doing your requirements which is leadtools. You can check this Tutorial
回答2:
I would always try to pick up something already on the web and tweak it to my own needs... some open source project or an example where the mainly portion of my app is already made.
on Codeplex you can find a nice library to work with webcams and it's simply called
WebCam Library for WinForm and WPF with C# and VB.NET
Give that a try, maybe you can even help the project, by contributing your own findings, and everyone is a winner... isn't Open Source a great idea?!
来源:https://stackoverflow.com/questions/10591036/net-3-5-windows-form-application-using-webcam