WPF如何使用AForge调用本机摄像头
WPF开发者QQ群: 340500857
前言
WPF展示摄像头的方式有很多种比如:OpenCV、EmguCV、Accord、AForge,此片主要讲解AForge。
一、使用 NuGet 搜索 AForge 安装。(如图)
二、在 XAML 中添加 前段代码展示摄像头。
<Grid>
<Image HorizontalAlignment="Stretch" Name="frameHolder" VerticalAlignment="Stretch" Stretch="Fill"/>
</Grid>
三、编写后台逻辑。
VideoCaptureDevice LocalWebCam;
FilterInfoCollection LoaclWebCamsCollection;
private void MainWindow_Loaded(object sender, RoutedEventArgs e)
{
LoaclWebCamsCollection = new