How do I connect to a USB webcam in .NET?(如何在 .NET 中连接到 USB 网络摄像头?)
问题描述
我想连接到 .NET 中的 USB 网络摄像头,特别是使用 C#.作为 .NET 的新手,我不知道标准库中有什么样的支持.我在网上找到了一个通过剪贴板复制位图的示例,但这看起来很笨拙(而且可能很慢).有没有更好的办法?
I want to connect to a USB Webcam in .NET, specifically using C#. Being new to .NET I don't know what kind of support there is in the standard libraries for doing so. I found one example on the web that copies bitmaps through the clipboard, but that seems very hacky (and probably slow). Is there a better way?
推荐答案
您需要使用 Windows 图像采集 (WIA) 将网络摄像头与您的应用程序集成.有很多这样的现成的例子.这是 C# 网络摄像头用户控件 带有来源.
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:
- MSDN Coding4Fun:看看我!Windows 图像采集
- 代码项目:WIA 脚本和 .NET李>
- CodeProject:WebCam 快速图像捕获服务使用 WIA
- clausn.dk:来自 C# 和 WIA 的网络摄像头控制
这篇关于如何在 .NET 中连接到 USB 网络摄像头?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在 .NET 中连接到 USB 网络摄像头?


基础教程推荐
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01
- JSON.NET 中基于属性的类型解析 2022-01-01
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01
- 如何动态获取文本框中datagridview列的总和 2022-01-01
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01
- 全局 ASAX - 获取服务器名称 2022-01-01
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01