视频运行库AVICAP32.DLL说明

// ------------------------------------------------------------------
//  窗口消息 WM_CAP... 哪个是送到 AVICAP 窗口
// ------------------------------------------------------------------

// 开始定义消息参数  整数型
const  avicap32='avicap32.dll';

WM_CAP_START= WM_USER=1024;

// start of unicode messages
WM_CAP_UNICODE_START=            WM_USER+100; //开始

WM_CAP_GET_CAPSTREAMPTR=         (WM_CAP_START+  1); //获得 CAPSTR EAMPTR

WM_CAP_SET_CALLBACK_ERROR=       (WM_CAP_START+  2); //设置收回错误
WM_CAP_SET_CALLBACK_STATUS=      (WM_CAP_START+  3); //设置收回状态

WM_CAP_SET_CALLBACK_YIELD=       (WM_CAP_START+  4); //设置收回出产
WM_CAP_SET_CALLBACK_FRame=       (WM_CAP_START+  5); //设置收回结构
WM_CAP_SET_CALLBACK_VIDEOSTREAM= (WM_CAP_START+  6); //设置收回视频流
WM_CAP_SET_CALLBACK_WAVESTREAM=  (WM_CAP_START+  7); //设置收回视频波流
WM_CAP_GET_USER_DATA            =(WM_CAP_START+  8); //获得使用者数据
WM_CAP_SET_USER_DATA           =(WM_CAP_START+  9) ; //设置使用者数据

WM_CAP_DRIVER_CONNECT          =(WM_CAP_START+  10); //驱动程序连接
WM_CAP_DRIVER_DISCONNECT       =(WM_CAP_START+  11); //断开启动程序连接

WM_CAP_DRIVER_GET_NAME         =(WM_CAP_START+  12); //获得驱动程序名字
WM_CAP_DRIVER_GET_VERSION      =(WM_CAP_START+  13); //获得驱动程序版本

WM_CAP_DRIVER_GET_CAPS         =(WM_CAP_START+  14); //获得驱动程序帽子

WM_CAP_FILE_SET_CAPTURE_FILE    =(WM_CAP_START+  20); //设置捕获文件
WM_CAP_FILE_GET_CAPTURE_FILE    =(WM_CAP_START+  21); //获得捕获文件
WM_CAP_FILE_SAVEAS              =(WM_CAP_START+  23); //另存文件为
WM_CAP_FILE_SAVEDIB             =(WM_CAP_START+  25); //保存文件

// out of order to save on ifdefs
WM_CAP_FILE_ALLOCATE           =(WM_CAP_START+  22); //分派文件
WM_CAP_FILE_SET_INFOCHUNK      =(WM_CAP_START+  24); //设置开始文件

WM_CAP_EDIT_COPY               =(WM_CAP_START+  30); //编辑复制

WM_CAP_SET_AUDIOFORMAT         =(WM_CAP_START+  35); //设置音频格式
WM_CAP_GET_AUDIOFORMAT         =(WM_CAP_START+  36); //捕获音频格式

WM_CAP_DLG_VIDEOFORMAT         =(WM_CAP_START+  41); //1065 打开视频格式设置对话框
WM_CAP_DLG_VIDEOSOURCE         =(WM_CAP_START+  42); //1066 打开属性设置对话框,设置对比度、亮度等。
WM_CAP_DLG_VIDEODISPLAY        =(WM_CAP_START+  43); //1067 打开视频显示
WM_CAP_GET_VIDEOFORMAT         =(WM_CAP_START+  44); //1068 获得视频格式
WM_CAP_SET_VIDEOFORMAT         =(WM_CAP_START+  45); //1069 设置视频格式
WM_CAP_DLG_VIDEOCOMPRESSION    =(WM_CAP_START+  46); //1070 打开压缩设置对话框

WM_CAP_SET_PREVIEW             =(WM_CAP_START+  50); //设置预览
WM_CAP_SET_OVERLAY             =(WM_CAP_START+  51); //设置覆盖
WM_CAP_SET_PREVIEWRATE         =(WM_CAP_START+  52); //设置预览比例
WM_CAP_SET_SCALE               =(WM_CAP_START+  53); //设置刻度
WM_CAP_GET_STATUS              =(WM_CAP_START+  54); //获得状态
WM_CAP_SET_SCROLL              =(WM_CAP_START+  55); //设置卷

WM_CAP_GRAB_FRame              =(WM_CAP_START+  60); //逮捕结构
WM_CAP_GRAB_FRame_NOSTOP       =(WM_CAP_START+  61); //停止逮捕结构

WM_CAP_SEQUENCE                =(WM_CAP_START+  62); //次序
WM_CAP_SEQUENCE_NOFILE         =(WM_CAP_START+  63); //没有文件
WM_CAP_SET_SEQUENCE_SETUP      =(WM_CAP_START+  64); //设置安装次序
WM_CAP_GET_SEQUENCE_SETUP      =(WM_CAP_START+  65); //获得安装次序

WM_CAP_SET_MCI_DEVICE          =(WM_CAP_START+  66); //设置媒体控制接口
WM_CAP_GET_MCI_DEVICE          =(WM_CAP_START+  67); //获得媒体控制接口

WM_CAP_STOP                    =(WM_CAP_START+  68); //停止
WM_CAP_ABORT                   =(WM_CAP_START+  69); //异常中断

WM_CAP_SINGLE_FRame_OPEN       =(WM_CAP_START+  70); //打开单一的结构
WM_CAP_SINGLE_FRame_CLOSE      =(WM_CAP_START+  71); //关闭单一的结构
WM_CAP_SINGLE_FRame            =(WM_CAP_START+  72); //单一的结构

WM_CAP_PAL_OPEN                =(WM_CAP_START+  80); //打开视频
WM_CAP_PAL_SAVE                =(WM_CAP_START+  81); //保存视频

WM_CAP_PAL_PASTE               =(WM_CAP_START+  82); //粘贴视频
WM_CAP_PAL_AUTOCREATE          =(WM_CAP_START+  83); //自动创造
WM_CAP_PAL_MANUALCREATE        =(WM_CAP_START+  84); //手动创造

// Following added post VFW 1.1
WM_CAP_SET_CALLBACK_CAPCONTROL =(WM_CAP_START+  85); // 设置收回的错误

WM_CAP_END                      =WM_CAP_SET_CALLBACK_CAPCONTROL; 

#region 导入API函数 [DllImport("avicap32.dll")]//包含了执行视频捕获的函数,它给AVI文件I/O和视频、音频设备驱动程序提供一个高级接口 public static extern IntPtr capCreateCaptureWindow(string lpszWindowName, int dwStyle, int x, int y, int nWidth, int nHeight, IntPtr hwndParent, int nID); /************参数说明************* * * 函数:capCreateCaptureWindow * * lpszWindowName:标识窗口的名称 * dwStyle:标识窗口风格 * x、y:标识窗口的左上角坐标 * nWidth、nHeight:标识窗口的宽度和高度 * hWnd:标识父窗口句柄 * nID:标识窗口ID * * 返回值:视频捕捉窗口句柄。 * ********************************/ [DllImport("AVICAP32.dll", CharSet = CharSet.Unicode)] public static extern bool capGetDriverDescription(int wDriverIndex, StringBuilder lpszName, int cbName, StringBuilder lpszVer, int cbVer); [DllImport("User32.dll")] public static extern bool SendMessage(IntPtr hWnd, int wMsg, bool wParam, int lParam); [DllImport("User32.dll")] public static extern bool SendMessage(IntPtr hWnd, int wMsg, short wParam, int lParam); [DllImport("User32.dll")] public static extern bool SendMessage(IntPtr hWnd, int wMsg, int wParam, int lParam); [DllImport("User32.dll")] public static extern bool SendMessage(IntPtr hWnd, int wMsg, short wParam, FrameEventHandler lParam); [DllImport("User32.dll")] public static extern bool SendMessage(IntPtr hWnd, int wMsg, int wParam, ref BITMAPINFO lParam); [DllImport("User32.dll")] public static extern bool SendMessage(IntPtr hWnd, int wMsg, int wParam, ref CAPDRIVERCAPS lParam); [DllImport("User32.dll")] public static extern bool SendMessage(IntPtr hWnd, int wMsg, int wParam, ref CAPTUREPARMS lParam); [DllImport("User32.dll")] public static extern bool SendMessage(IntPtr hWnd, int wMsg, int wParam, ref CAPSTATUS lParam); [DllImport("User32.dll")] public static extern int SetWindowPos(IntPtr hWnd, int hWndInsertAfter, int x, int y, int cx, int cy, int wFlags); [DllImport("avicap32.dll")] public static extern int capGetVideoFormat(IntPtr hWnd, IntPtr psVideoFormat, int wSize); #endregion
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值