Page 221 - PDA Robotics Using Your Personal Digital Assistant to Control Your Robot
P. 221

PDA 10  5/27/03  8:51 AM  Page 197
                                      }else{
                                        //   Chapter 10 / The PDA Robotics Command Center
                                        // No Driver Detected
                                      }
                                   }
                                   m_stretch_video.SetCheck(1);

                                   //
                                   // Add the name of the video driver to the title bar of the window
                                   //

                                   code = capDriverGetName( h_capwin, &szName[0], wSize );
                                   if( code == TRUE )
                                   {
                                      title_text += " - Capture driver : ";
                                      title_text += szName;
                                      this->SetWindowText(title_text);
                                   }

                                 }
                                 The video should now be displayed on the main window, as shown in
                                 Figure 10.1. If the user has selected motion detection, stream the video
                                 into  a  callback  function,  checking  to  see  if  anything  has  changed
                                 between the first image that was stored in memory and the current
                                 frame.


                                 Motion Detection

                                 void CBeamDlg::OnCheckVision()
                                 {
                                   if( m_check_vision.GetCheck() == 1)
                                   {
                                      m_radar_stat.SetWindowText("Motion Sense : ON");
                                      //
                                      // Disable stretch feature... the stretch requires significant processor cycles
                                      //
                                      if( m_stretch_video.GetCheck()  == 1 )
                                      {
                                        m_stretch_video.SetCheck(0);
                                        capPreviewScale(h_capwin, FALSE);
                                        m_stretch_video.EnableWindow(FALSE);
                                        this->InvalidateRect(NULL, TRUE);
                                      }

                                                                                               197
   216   217   218   219   220   221   222   223   224   225   226