Page 220 - PDA Robotics Using Your Personal Digital Assistant to Control Your Robot
P. 220
PDA 10 5/27/03 8:51 AM Page 196
Figure 10.1
Command center. PDA Robotics
//
BOOL code = capDlgVideoSource(h_capwin);
//
// Create the Capture window
//
h_capwin = ::capCreateCaptureWindow("PDABot Video",
WS_CHILD|WS_CLIPSIBLINGS|WS_VISIBLE|WS_EX_DLGMODALFRAME ,
20,
20
,320,
240,this->m_hWnd,0
);
//
// Hook into the video driver. Check up to 10 and use the first one encountered
//
for( int j=0; j<10;j++){
code = capDriverConnect(h_capwin, j);
if(code){
// Select the video source
code = capDlgVideoSource(h_capwin);
// Set the preview rate
code = capPreviewRate(h_capwin, 100);
// turn video previewing on
code = capPreview(h_capwin, TRUE );
break;
196