cvNamedWindow( "Example2", CV_WINDOW_AUTOSIZE );CvCapture* capture = cvCreateCameraCapture(0);int width = (int)cvGetCaptureProperty(capture,CV_CAP_PROP_FRAME_WIDTH);int height = (int)cvGetCaptureProperty(capture,CV_CAP_PROP_FRAME_HEIGHT);IplImage* frame;while(1){
frame = cvQueryFrame( capture );if( !frame ) break;cvShowImage( "Example2", frame );char c = cvWaitKey(33);if( c == 27 ) break;
}cvReleaseCapture( &capture );cvDestroyWindow( "Example2" );