你好 这里是明日科技公司图书论坛
需要创建视频捕捉窗口 参考如下代码:、
m_hWndVideo = capCreateCaptureWindow(NULL,WS_POPUP, 1, 1, 10, 10, m_hWnd, 0);
if (capDriverConnect(m_hWndVideo, 0))
{
::SetParent(m_hWndVideo,*this);
::SetWindowLong(m_hWndVideo,GWL_STYLE,WS_CHILD);
CRect wndRC;
m_Panel.GetClientRect(wndRC);
m_Panel.MapWindowPoints(this,wndRC);
wndRC.DeflateRect(1,1,1,1);
::SetWindowPos(m_hWndVideo,NULL,wndRC.left,wndRC.top,wndRC.Width(),wndRC.Height(),SWP_NOZORDER);
::ShowWindow(m_hWndVideo,SW_SHOW);
CAPDRIVERCAPS caps;
capDriverGetCaps(m_hWndVideo,sizeof(caps),&caps);
if (caps.fHasOverlay)
capOverlay(m_hWndVideo,TRUE);
CAPTUREPARMS params;
capCaptureGetSetup(m_hWndVideo,¶ms,sizeof(params));
params.fYield = TRUE;
params.fAbortLeftMouse = FALSE;
params.fAbortRightMouse = FALSE;
params.fLimitEnabled = FALSE;
params.vKeyAbort = FALSE;
params.fCaptureAudio = FALSE;
capCaptureSetSetup(m_hWndVideo,¶ms, sizeof(params));
capSetCallbackOnVideoStream(m_hWndVideo, EncodeCallback);
capPreviewRate(m_hWndVideo,30);
capPreview(m_hWndVideo, TRUE);
capCaptureSequenceNoFile(m_hWndVideo);
你可以查看我公司VC++范例完全自学手册等书,上面有关于摄像头视频捕捉的程序。