1 / 3
文档名称:

USB摄像头编程.doc

格式:doc   大小:70KB   页数:3页
下载后只包含 1 个 DOC 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

USB摄像头编程.doc

上传人:260933426 2017/8/22 文件大小:70 KB

下载得到文件列表

USB摄像头编程.doc

文档介绍

文档介绍:USB摄像头编程
关键字:USB 摄像头, capCreateCaptureWindowA ,
正文:
在我们做《学生网上报名系统》中,要采集学生照片,在对照片质量要求不是很高的情况下,我们想到了用摄像头作为照片输入设备。
我做了照片采集程序,与原有的数据库程序结合得非常好,现将有关程序发布,如果有需要的同行,不难写出自己的摄像头控制程序。
在API函数中,capCreateCaptureWindowA实现了对摄像头采集图片的封装,函数原型如下:
HWND VFWAPI capCreateCaptureWindow(
LPCSTR lpszWindowName,
DWORD dwStyle,
int x,
int y,
int nWidth,
int nHeight,
HWND hWnd,
int nID
);
大家可以参看联机文档,弄清每一个参数的说明。
LpszWindowName:Null-terminated string containing the name used for the capture window.
DwStyle:Window styles used for the capture window. Window styles are described with the CreateWindowEx function.
x and y:The x- and y-coordinates of the upper left corner of the capture window.
nWidth and nHeight:Width and height of the capture window.
HWnd:Handle of the parent window.
NID:Window identifier.
Return Values
Returns a handle of the capture window if essful or NULL otherwise.
,该头文件还包含了大量的相关函数,有兴趣的朋友,可以仔细研究。首先将其包含进来。
以下是全部源程序:
//---------------------------------------------------------------------------
#include <>
#include <> //add head file.
#pragma hdrstop
#include ""
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
HWND hWndC;
//---------------------------------------------------------------------------
__fastcal