能录像和抓拍图像。您可以使用函数function ulong capCreateCaptureWindowA(string lpszWindowName,ulong dwStyle,long x,long y,long nWidth,long nHeight,ulong ParentWin,long nId ) LIBRARY 'AVICAP32.DLL'
;
///开始事件:
string lpszName
ulong l1
l1=handle(win_test)
lpszName='摄像头界面...'
//capCreateCaptureWindowA(string lpszWindowName,ulong dwStyle,long x,long y,long nWidth,long nHeight,ulong ParentWin,long nId )
lhand=capCreateCaptureWindowA(lpszName,262144+12582912+1073741824 + 268435456 ,60,0,150,200,l1,0)
if lhand <> 0 then
send(lhand, WM_CAP_SET_CALLBACK_VIDEOSTREAM, 0, 0)
send(lhand, WM_CAP_SET_CALLBACK_ERROR, 0, 0)
send(lhand, WM_CAP_SET_CALLBACK_STATUSA, 0, 0)
send(lhand, WM_CAP_DRIVER_CONNECT, 0, 0)
send(lhand, WM_CAP_SET_SCALE, 1, 0)
send(lhand, WM_CAP_SET_PREVIEWRATE, 66, 0)
send(lhand, WM_CAP_SET_OVERLAY, 1, 0)
send(lhand, WM_CAP_SET_PREVIEW, 1, 0)
end if
////录像事件
string s
s='c:\save.avi'
if lhand<>0 then
Send(lhand,WM_CAP_FILE_SET_CAPTURE_FILEA,0, s);
Send(lhand,WM_CAP_SEQUENCE, 0, 0) //开始捕捉
end if
//停止保存
send(lhand, WM_CAP_STOP, 0, 0)
/////保存图像
//保存为图片(按钮的clicked事件中)
string s
s='c:\save.bmp'
if lhand <> 0 then
Send(lhand,WM_CAP_SAVEDIB,0,s);
end if