资源简介
C# WinForm DirectShow视频采集及图片抓取实例DxSnap 抓拍 视频

代码片段和文件信息
/****************************************************************************
While the underlying libraries are covered by LGPL this sample is released
as public domain. It is distributed in the hope that it will be useful but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE.
*****************************************************************************/
using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.Collections;
using System.Runtime.InteropServices;
using System.Threading;
using System.Diagnostics;
using System.Windows.Forms;
using DirectShowLib;
namespace SnapShot
{
/// Summary description for MainForm.
internal class Capture : ISampleGrabberCB IDisposable
{
#region Member variables
/// graph builder interface.
private IFilterGraph2 m_FilterGraph = null;
// Used to snap picture on Still pin
private IAMVideoControl m_VidControl = null;
private IPin m_pinStill = null;
/// so we can wait for the async job to finish
private ManualResetEvent m_PictureReady = null;
private bool m_WantOne = false;
/// Dimensions of the image calculated once in constructor for perf.
private int m_videoWidth;
private int m_videoHeight;
private int m_stride;
/// buffer for bitmap data. Always release by caller
private IntPtr m_ipBuffer = IntPtr.Zero;
#if DEBUG
// Allow you to “Connect to remote graph“ from GraphEdit
DsROTEntry m_rot = null;
#endif
#endregion
#region APIs
[DllImport(“Kernel32.dll“ EntryPoint = “RtlMoveMemory“)]
private static extern void CopyMemory(IntPtr Destination IntPtr Source [MarshalAs(UnmanagedType.U4)] int Length);
#endregion
// Zero based device index and device params and output window
public Capture(int iDeviceNum int iWidth int iHeight short iBPP Control hControl)
{
DsDevice[] capDevices;
// Get the collection of video devices
capDevices = DsDevice.GetDevicesOfCat(FilterCategory.VideoInputDevice);
if (iDeviceNum + 1 > capDevices.Length)
{
throw new Exception(“No video capture devices found at that index!“);
}
try
{
// Set up the capture graph
SetupGraph(capDevices[iDeviceNum] iWidth iHeight iBPP hControl);
// tell the callback to ignore new images
m_PictureReady = new ManualResetEvent(false);
}
catch
{
Dispose();
throw;
}
}
/// release everyt
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 187 2019-04-29 23:06 DirectShowDxSnap\WindowsFormsApplication1\App.config
文件 312320 2016-07-08 20:24 DirectShowDxSnap\WindowsFormsApplication1\bin\Debug\DirectShowLib-2005.dll
文件 16896 2019-04-30 10:06 DirectShowDxSnap\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.exe
文件 187 2019-04-29 23:06 DirectShowDxSnap\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.exe.config
文件 32256 2019-04-30 10:06 DirectShowDxSnap\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.pdb
文件 23168 2019-04-30 10:09 DirectShowDxSnap\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe
文件 187 2019-04-29 23:06 DirectShowDxSnap\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe.config
文件 490 2010-03-17 22:39 DirectShowDxSnap\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe.manifest
文件 18864 2019-04-30 09:12 DirectShowDxSnap\WindowsFormsApplication1\Capture.cs
文件 3983 2019-04-29 23:13 DirectShowDxSnap\WindowsFormsApplication1\DirectShowDxSnap.csproj
文件 312320 2016-07-08 20:24 DirectShowDxSnap\WindowsFormsApplication1\DirectShowLib-2005.dll
文件 6899 2019-04-30 10:06 DirectShowDxSnap\WindowsFormsApplication1\Form1.cs
文件 4617 2019-04-30 09:15 DirectShowDxSnap\WindowsFormsApplication1\Form1.Designer.cs
文件 5817 2019-04-30 09:53 DirectShowDxSnap\WindowsFormsApplication1\Form1.resx
文件 865 2019-04-29 23:06 DirectShowDxSnap\WindowsFormsApplication1\obj\Debug\DesignTimeResolveAssemblyReferences.cache
文件 7096 2019-04-30 09:03 DirectShowDxSnap\WindowsFormsApplication1\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 879 2019-04-30 10:09 DirectShowDxSnap\WindowsFormsApplication1\obj\Debug\DirectShowDxSnap.csproj.FileListAbsolute.txt
文件 977 2019-04-30 10:06 DirectShowDxSnap\WindowsFormsApplication1\obj\Debug\DirectShowDxSnap.csproj.GenerateResource.Cache
文件 180 2019-04-30 10:06 DirectShowDxSnap\WindowsFormsApplication1\obj\Debug\SnapShot.Form1.resources
文件 0 2019-04-29 23:06 DirectShowDxSnap\WindowsFormsApplication1\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
文件 0 2019-04-29 23:06 DirectShowDxSnap\WindowsFormsApplication1\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
文件 0 2019-04-29 23:06 DirectShowDxSnap\WindowsFormsApplication1\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
文件 1162 2019-04-30 09:02 DirectShowDxSnap\WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.csproj.FileListAbsolute.txt
文件 977 2019-04-30 09:01 DirectShowDxSnap\WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.csproj.GenerateResource.Cache
文件 6691 2019-04-29 23:13 DirectShowDxSnap\WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.csprojResolveAssemblyReference.cache
文件 16896 2019-04-30 10:06 DirectShowDxSnap\WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.exe
文件 32256 2019-04-30 10:06 DirectShowDxSnap\WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.pdb
文件 180 2019-04-30 10:06 DirectShowDxSnap\WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.Properties.Resources.resources
文件 520 2019-04-29 23:13 DirectShowDxSnap\WindowsFormsApplication1\Program.cs
文件 1372 2019-04-29 23:06 DirectShowDxSnap\WindowsFormsApplication1\Properties\AssemblyInfo.cs
............此处省略19个文件信息
- 上一篇:Echart使用demo
- 下一篇:C#手写识别源码
相关资源
- C#百度地图源码
- Visual C#.2010从入门到精通配套源程序
- Winform可视化打印模板设计工具含源码
- C# 软件版本更新
- C#屏幕软键盘源码,可以自己定制界面
- 智慧城市 智能家居 C# 源代码
- c#获取mobile手机的IMEI和IMSI
- C#实现简单QQ聊天程序
- 操作系统 模拟的 欢迎下载 C#版
- C#写的计算机性能监控程序
- 用C#实现邮件发送,有点类似于outlo
- MVC model层代码生成器 C#
- c#小型图书销售系统
- C# Socket Server Client 通讯应用 完整的服
- c# winform 自动登录 百度账户 源代码
- C#编写的16进制计算器
- C#TCP通信协议
- C# 数据表(Dataset)操作 合并 查询一
- C#语音识别系统speechsdk51,SpeechSDK51L
- 数据库备份还原工具1.0 C# 源码
-
[免费]xm
lDocument 节点遍历C# - EQ2008LEDc#开发实例
- DirectX.Capturec# winform 操作摄像头录像附
- c# 实现的最大最小距离方法对鸢尾花
- C#版保龄球记分代码
- C#自定义控件
- 基于c#的实验室设备管理系统621530
- C# 使用ListView控件实现图片浏览器(源
- C#简单窗体聊天程序
- C#指纹识别系统程序 报告
评论
共有 条评论