一、VFW简介
VFW(Video for Windows)是微软提供的数字视频开发包。
VFW有许多函数,详细可参考http://blog.youkuaiyun.com/laolei1986/article/details/5733051
下面介绍几个用到的函数:
1、创建视频捕捉窗口
HWND VFWAPI capCreateCaptureWindow(
LPCSTR lpszWindowName, //视频捕捉窗口的名称
DWORD dwStyle, //视频捕捉窗口风格,比如WS_CHILD和 WS_VISIBLE
int x,//(x,y)表示视频捕捉窗口的左上角坐标
int y,
int nWidth, //窗口宽度
int nHeight, //窗口高度
HWND hWnd, //父窗口句柄
int nID//窗口标志
);
2、视频驱动程序与预览窗口连接函数BOOL VFWAPI capDriverConnect(
HWND hWnd, //capCreateWindow函数生成的窗口句柄,即捕捉窗口句柄
int driverId //驱动程序编号,默认为0。可以在System.ini文件中查找
);
3、设置预览帧频率
BOOL VFWAPI capPreviewRate(
HWND hWnd, //预览窗口句柄
in frame//帧频率
);
4、预览函数
BOOL VFWAPI capPreview(
HWNDhWnd, //预览窗口句柄
BOOL