天天看点

1.1.4-学习Opencv与MFC混合编程之---画图工具 画椭圆

源代码地址:http://download.csdn.net/detail/nuptboyzhb/3961690

2.    编辑消息处理函数,设置画图变量标识my_draw_flag为5,并读取对话框里的数据。

3.    修改OnMouseMove消息处理函数。

3.1增加变量CvSize

 CvSize EllipseSize;

3.2           case 5的编程:

         case 5:

                            EllipseSize.width=abs(my_cvpoint1.x-iner_point.x);

           EllipseSize.height=abs(my_cvpoint1.y-iner_point.y);

                            cvFlip(src);

                            cvEllipse(src,my_cvpoint1,EllipseSize,0,0,360,cvScalar(colorB,colorG,colorR),thickness);

                            workImg=cvCloneImage(src);//拷贝到工作区

                            Invalidate();//重绘

                            break;

继续阅读