#pragma package <opencv>
#endif
+#define CV_NO_BACKWARD_COMPATIBILITY
+
#ifndef _EiC
#include "cv.h"
#include "highgui.h"
cvNamedWindow(wndname, 1 );
cvZero( image );
cvShowImage(wndname,image);
+ cvWaitKey(DELAY);
rng = cvRNG((unsigned)-1);
pt[0] = &(ptt[0]);
cvLine( image, pt1, pt2, random_color(&rng), cvRandInt(&rng)%10, line_type, 0 );
cvShowImage(wndname,image);
- cvWaitKey(DELAY);
+ if(cvWaitKey(DELAY) >= 0) return 0;
}
for (i = 0; i< NUMBER; i++)
cvRectangle( image,pt1, pt2, random_color(&rng), cvRandInt(&rng)%10-1, line_type, 0 );
cvShowImage(wndname,image);
- cvWaitKey(DELAY);
+ if(cvWaitKey(DELAY) >= 0) return 0;
}
for (i = 0; i< NUMBER; i++)
cvEllipse( image, pt1, sz, angle, angle - 100, angle + 200,
random_color(&rng), cvRandInt(&rng)%10-1, line_type, 0 );
cvShowImage(wndname,image);
- cvWaitKey(DELAY);
+ if(cvWaitKey(DELAY) >= 0) return 0;
}
for (i = 0; i< NUMBER; i++)
cvPolyLine( image, pt, arr, 2, 1, random_color(&rng), cvRandInt(&rng)%10, line_type, 0 );
cvShowImage(wndname,image);
- cvWaitKey(DELAY);
+ if(cvWaitKey(DELAY) >= 0) return 0;
}
for (i = 0; i< NUMBER; i++)
cvFillPoly( image, pt, arr, 2, random_color(&rng), line_type, 0 );
cvShowImage(wndname,image);
- cvWaitKey(DELAY);
+ if(cvWaitKey(DELAY) >= 0) return 0;
}
for (i = 0; i< NUMBER; i++)
cvCircle( image, pt1, cvRandInt(&rng)%300, random_color(&rng),
cvRandInt(&rng)%10-1, line_type, 0 );
cvShowImage(wndname,image);
- cvWaitKey(DELAY);
+ if(cvWaitKey(DELAY) >= 0) return 0;
}
for (i = 1; i< NUMBER; i++)
pt1.y=cvRandInt(&rng) % height3 - height;
cvInitFont( &font, cvRandInt(&rng) % 8,
- (cvRandInt(&rng)%100)*0.05+0.1, (cvRandInt(&rng)%100)*0.05+0.1,
+ (cvRandInt(&rng)%100)*0.05+0.1, (cvRandInt(&rng)%100)*0.05+0.1,
(cvRandInt(&rng)%5)*0.1, cvRound(cvRandInt(&rng)%10), line_type );
cvPutText( image, "Testing text rendering!", pt1, &font, random_color(&rng));
cvShowImage(wndname,image);
- cvWaitKey(DELAY);
+ if(cvWaitKey(DELAY) >= 0) return 0;
}
cvInitFont( &font, CV_FONT_HERSHEY_COMPLEX, 3, 3, 0.0, 5, line_type );
cvSubS( image2, cvScalarAll(i), image, 0 );
cvPutText( image, "OpenCV forever!", pt1, &font, CV_RGB(255,i,i));
cvShowImage(wndname,image);
- cvWaitKey(DELAY);
+ if(cvWaitKey(DELAY) >= 0) return 0;
}
// Wait for a key stroke; the same function arranges events processing