资源简介
文件是采用C#开发语言实现视频监控的功能包含录制视频拍照截图存图等
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using AForge.Video.DirectShow;
using AForge.Video.FFMPEG;
using AForge.Controls;
using AForge.Video;
using AForge.Imaging;
using System.IO;
using System.Drawing.Imaging;
namespace AForgenetVideoControlFormBeta
{
public partial class MainForm : Form
{
private VideoCaptureDevice _videoDevice = null;
private VideoFileWriter _videoWrite = null;
private string _imagePath = Environment.CurrentDirectory + “\\Images\\“;
private string _videoPath = Environment.CurrentDirectory + “\\Videos\\“;
public MainForm()
{
InitializeComponent();
}
private void MainForm_Load(object sender EventArgs e)
{
//
if (!Directory.Exists(_imagePath))
Directory.CreateDirectory(_imagePath);
if (!Directory.Exists(_videoPath))
Directory.CreateDirectory(_videoPath);
}
private void MainForm_FormClosing(object sender FormClosingEventArgs e)
{
if (videoSourcePlayer1.IsRunning)
{
videoSourcePlayer1.Stop();
if (_videoDevice != null)
_videoDevice.SignalToStop();
}
}
private void btnOpenVideo_Click(object sender EventArgs e)
{
if (videoSourcePlayer1.IsRunning)
videoSourcePlayer1.Stop();
VideoCaptureDeviceForm form = new VideoCaptureDeviceForm();
if (form.ShowDialog(this) != System.Windows.Forms.DialogResult.OK)
return;
_videoDevice = form.VideoDevice;
videoSourcePlayer1.VideoSource = form.VideoDevice;
videoSourcePlayer1.Start();
}
private void btnCloseVideo_Click(object sender EventArgs e)
{
if (videoSourcePlayer1.IsRunning)
{
videoSourcePlayer1.Stop();
if (_videoDevice != null)
_videoDevice.SignalToStop();
}
}
private void btnCapture_Click(object sender EventArgs e)
{
if (!videoSourcePlayer1.IsRunning)
return;
Bitmap bmp = videoSourcePlayer1.GetCurrentVideoframe();
string fileName = DateTime.Now.ToString(“yyyy-MM-dd HH-mm-ss-ff“) + “.jpg“;
bmp.Save(_imagePath + fileName ImageFormat.Jpeg);
bmp.Dispose();
}
private void btnStartVideotape_Click(object sender EventArgs e)
{
string videoFileName = string.Empty;
//SaveFileDialog saveFile = new SaveFileDialog();
//saveFile.Filter = “Flash Video(*.flv)|*.
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2015-09-16 22:29 AForgenetVideoControlFormBeta\
目录 0 2015-09-17 20:51 AForgenetVideoControlFormBeta\AForgenetVideoControlFormBeta\
文件 6148 2015-09-17 22:24 AForgenetVideoControlFormBeta\AForgenetVideoControlFormBeta\AForgenetVideoControlFormBeta.csproj
文件 264 2015-09-17 22:28 AForgenetVideoControlFormBeta\AForgenetVideoControlFormBeta\App.config
文件 7971 2015-09-17 23:28 AForgenetVideoControlFormBeta\AForgenetVideoControlFormBeta\MainForm.Designer.cs
文件 5391 2015-09-17 23:40 AForgenetVideoControlFormBeta\AForgenetVideoControlFormBeta\MainForm.cs
文件 5817 2015-09-17 23:28 AForgenetVideoControlFormBeta\AForgenetVideoControlFormBeta\MainForm.resx
文件 544 2015-09-17 21:00 AForgenetVideoControlFormBeta\AForgenetVideoControlFormBeta\Program.cs
目录 0 2015-09-16 22:29 AForgenetVideoControlFormBeta\AForgenetVideoControlFormBeta\Properties\
文件 1378 2015-09-16 22:29 AForgenetVideoControlFormBeta\AForgenetVideoControlFormBeta\Properties\AssemblyInfo.cs
文件 2898 2015-09-17 22:24 AForgenetVideoControlFormBeta\AForgenetVideoControlFormBeta\Properties\Resources.Designer.cs
文件 5612 2015-09-16 22:29 AForgenetVideoControlFormBeta\AForgenetVideoControlFormBeta\Properties\Resources.resx
文件 1129 2015-09-17 22:24 AForgenetVideoControlFormBeta\AForgenetVideoControlFormBeta\Properties\Settings.Designer.cs
文件 249 2015-09-16 22:29 AForgenetVideoControlFormBeta\AForgenetVideoControlFormBeta\Properties\Settings.settings
目录 0 2015-09-19 08:54 AForgenetVideoControlFormBeta\AForgenetVideoControlFormBeta\bin\
目录 0 2015-09-17 21:43 AForgenetVideoControlFormBeta\AForgenetVideoControlFormBeta\bin\x86\
目录 0 2015-09-19 08:53 AForgenetVideoControlFormBeta\AForgenetVideoControlFormBeta\bin\x86\Debug\
文件 44544 2013-07-15 23:04 AForgenetVideoControlFormBeta\AForgenetVideoControlFormBeta\bin\x86\Debug\AForge.Controls.dll
文件 16384 2013-07-15 23:04 AForgenetVideoControlFormBeta\AForgenetVideoControlFormBeta\bin\x86\Debug\AForge.Imaging.Formats.dll
文件 262656 2013-07-15 23:04 AForgenetVideoControlFormBeta\AForgenetVideoControlFormBeta\bin\x86\Debug\AForge.Imaging.dll
文件 68096 2013-07-15 23:04 AForgenetVideoControlFormBeta\AForgenetVideoControlFormBeta\bin\x86\Debug\AForge.Math.dll
文件 61440 2013-07-15 23:04 AForgenetVideoControlFormBeta\AForgenetVideoControlFormBeta\bin\x86\Debug\AForge.Video.DirectShow.dll
文件 61952 2013-07-15 23:07 AForgenetVideoControlFormBeta\AForgenetVideoControlFormBeta\bin\x86\Debug\AForge.Video.FFMPEG.dll
文件 20992 2013-07-15 23:04 AForgenetVideoControlFormBeta\AForgenetVideoControlFormBeta\bin\x86\Debug\AForge.Video.dll
文件 17920 2013-07-15 23:04 AForgenetVideoControlFormBeta\AForgenetVideoControlFormBeta\bin\x86\Debug\AForge.dll
文件 13312 2015-09-17 23:42 AForgenetVideoControlFormBeta\AForgenetVideoControlFormBeta\bin\x86\Debug\AForgenetVideoControlFormBeta.exe
文件 264 2015-09-17 22:28 AForgenetVideoControlFormBeta\AForgenetVideoControlFormBeta\bin\x86\Debug\AForgenetVideoControlFormBeta.exe.config
文件 30208 2015-09-17 23:42 AForgenetVideoControlFormBeta\AForgenetVideoControlFormBeta\bin\x86\Debug\AForgenetVideoControlFormBeta.pdb
文件 22984 2015-09-17 23:43 AForgenetVideoControlFormBeta\AForgenetVideoControlFormBeta\bin\x86\Debug\AForgenetVideoControlFormBeta.vshost.exe
文件 264 2015-09-17 22:28 AForgenetVideoControlFormBeta\AForgenetVideoControlFormBeta\bin\x86\Debug\AForgenetVideoControlFormBeta.vshost.exe.config
文件 490 2012-06-02 22:34 AForgenetVideoControlFormBeta\AForgenetVideoControlFormBeta\bin\x86\Debug\AForgenetVideoControlFormBeta.vshost.exe.manifest
............此处省略41个文件信息
- 上一篇:固高运动版卡例程C#版
- 下一篇:ASP.NET 2.0 典型项目开发
相关资源
- 固高运动版卡例程C#版
- c#myQQ完整项目
- C#图像处理编程+源程序
- WEB课设-图书馆管理系统
- 深度学习手写识别C#源码
- C#深度学习源码
- C#+SQL 医院管理系统HIS完整工程源码及
- C#入门-基于C#的Windows窗口应用程序教
- C_本质论(中文版)
- C#ASP_NET仿新浪微博客V2
- TeeChart在C和C#下的应用
- C#写的UDP即时聊天程序
- 基于RFID的图书管理系统
- c#仿QQ源代码附带数据库,QQ界面设计
- C# winform皮肤主题切换源码
- C# 大华网络摄像头的demo winfrom
- C#银行管理系统含数据库
- .net经典ERP管理系统完整源码(多层架
- TCP\\IP通信 C#
- 钉钉接口请求数据接入数据库c#源码
- asp.net C# 在线客服系统源码
- C# 图书管理系统 源码
- WINFORM C# 进销存软件源码
- HarrisCorner源代码
- C#串口助手源代码共六个打包
- C#酒店管理系统完整版
- 酒店管理系统 VS2008 + C# + SQLServer 含源
- c#调用大漠插件100%完美识别文字
- AForge桌面录屏c#
- 问卷调查系统c#
评论
共有 条评论