嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300
本次赞助数额为: 2 元微信扫码支付:2 元
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
参考下面的教学视频做的demo
https://www.bilibili.com/video/BV1hE411M7LV?from=search&seid=10422018013517685378
视频缺少安装dll后运行一下程序,在debug下就有了dll了,工具箱添加选项卡,取个名字,然后拖拽AForge.Controls.dll到选项卡里面,这样工具箱就有videoSourcePlay控件了。
FilterInfoCollection videoDevices;
VideoCaptureDevice videoSource;
private void StartVido_Click(object sender, EventArgs e)
{
this.videoSourcePlayer.SignalToStop(); //
videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice); //
videoSource = new VideoCaptureDevice(videoDevices[0].MonikerString); //
this.videoSourcePlayer.VideoSource = videoSource; //
this.videoSourcePlayer.Start(); //
}
private void CloseVido_Click(object sender, EventArgs e)
{
this.videoSourcePlayer.SignalToStop(); //
this.videoSourcePlayer.WaitForStop(); //
}
private void btn_Take_Click(object sender, EventArgs e)
{
string imageName = DateTime.Now.ToString("yyyMMddHHmmss");
string path = @"d:/" imageName ".jpg";
if (videoSourcePlayer==null)
{
return;
}
//
Bitmap bitmap = this.videoSourcePlayer.GetCurrentVideoFrame();
bitmap.Save(path);
}