title: OpenCV : How to display webcam capture in windows form application?
body: <p>generally we display webcam or video motion in opencv windows with :</p>
  
  <pre><code>      CvCapture* capture = cvCreateCameraCapture(0);
              cvNamedWindow( "title", CV_WINDOW_AUTOSIZE );
     cvMoveWindow("title",x,y);
     while(1) 
     {
      frame = cvQueryFrame( capture );
      if( !frame )
      {
       break;
      }
      cvShowImage( "title", frame );
      char c = cvWaitKey(33);
      if( c == 27 )
      {
       break;
      }
     }
  </code></pre>
  
  <p>i tried to use pictureBox that is successful to display image in windows form with this :</p>
  
  <pre><code> pictureBox1-&gt;Image = gcnew System::Drawing::Bitmap( image-&gt;width,image-&gt;height,image-&gt;widthStep,System::Drawing::Imaging::PixelFormat::Undefined, ( System::IntPtr ) image-&gt; imageData);
  </code></pre>
  
  <p>but when im trying to display captured image from video it wont works, here is the source :</p>
  
  <pre><code>            CvCapture* capture = cvCreateCameraCapture(0);
     while(1) 
     {
      frame = cvQueryFrame( capture );
      if( !frame )
      {
       break;
      }
      pictureBox1-&gt;Image = gcnew System::Drawing::Bitmap( frame-&gt;width,frame-&gt;height,frame-&gt;widthStep,System::Drawing::Imaging::PixelFormat::Undefined, ( System::IntPtr ) frame-&gt; imageData);
      char c = cvWaitKey(33);
      if( c == 27 )
      {
       break;
      }
     }
  </code></pre>
  
  <p>is there anyway to use windows form instead opencv windows to show video or webcam?</p>
  
  <p>or is there something wrong with my code?
  thanks for your help.. :)</p>