Create Your own MFC Dialog Project
Insert a few lines in the OnInitDialog
or download the source code
to read an image from the webcam initialize a window handle with capCreateCaptureWindow
and connect this handle with the installed webcam driver.
The first image is now in your window
BOOL CCam01Dlg::OnInitDialog()
{
CDialog::OnInitDialog();
SetIcon(m_hIcon, TRUE);
SetIcon(m_hIcon, FALSE);
// TODO:
hMyWindow = capCreateCaptureWindow("handle", WS_CHILD | WS_VISIBLE,
0, 0, ImageX, ImageY,
this->m_hWnd, 1);
// connect the driver with the webcam
bool xx = capDriverConnect(hMyWindow,0);
if(xx == false)
{
AfxMessageBox("Webcam not found ",0,0);
return false;
}
return TRUE;
}
