简体   繁体   English

使用网络摄像头和C#拍照

[英]take a photo using webcam with C#

I want to take a photo using a webcam from my application. 我想使用我的应用程序中的网络摄像头拍照。 How do I accomplish that? 我该怎么做? My application is developed in C# and to make a visitor's pass, I want to take a photo of the particular visitor when he enters the company building. 我的应用程序是用C#开发的,为了让访问者通过,我想为特定的访问者进入公司大楼拍照。

Try out jQuery Webcam 试用jQuery网络摄像头

I am struggling to get the save function to work, but its a start. 我正在努力使保存功能正常工作,但这只是一个开始。

Webcams all use a different API. 网络摄像头均使用不同的API。 Find the API that your webcam supports...let me know, and I will happily talk you through how to do it. 找到您的网络摄像头支持的API ...让我知道,我将很高兴地与您讨论如何实现。

I assume that you are talking WinForms? 我假设您在谈论WinForms?

You are going to need some kind of trusted client side code, if you want to do this. 如果要这样做,您将需要某种受信任的客户端代码。 Java, Flash, SilverLight are all possibilities. Java,Flash,SilverLight都是可能的。 But they may create a dependency on a particular WebCam/Software/API. 但是它们可能会创建对特定WebCam / Software / API的依赖关系。

You'd be much better off configuring your web cam to put its photos in a single place and have a web form that accepts a file upload. 您最好将网络摄像头配置为将其照片放置在一个地方,并具有可以接受文件上传的网络表单,这样会更好。

This way when your web cam breaks and you can't get the exact same device you don't have to recode. 这样,当网络摄像头损坏时,您将不必获得完全相同的设备,而不必重新编码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM