//编译环境VS2008+opencv2.4 #include "stdafx.h" #include "highgui.h" #include "cv.h" int _tmain(int argc, _TCHAR* argv[]) { //创建窗口 cvNamedWindow("ShowImage", CV_WINDOW_AUTOSIZE); //创建100*100的矩阵,并所有通道置零 IplImage* image= cvCreateImage(cvSize(100, 100), IPL_DEPTH_8U, 3); cvZero(image); //画圆 cvCircle(image, cvPoint(50, 50), 50, cvScalar(255, 0, 0), 1); cvShowImage("ShowImage", image); cvWaitKey(0); cvReleaseImage( &image); cvDestroyWindow("ShowImage"); return 0; }