資源簡介
文件是采用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 典型項目開發
評論
共有 條評論