Esempio n. 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (getCircleUseMetrology == null)
            {
                getCircleUseMetrology = new GetCircleUseMetrology();
                data   = getCircleUseMetrology;
                circle = null;
            }

            hWindow_Final1.HobjectToHimage(ho_Image); //刷新图片

            DrawMode(true);                           //绘制模式开启
            getCircleUseMetrology.parameter.Circle = Func_HalconFunction.DrawCircle(hWindow_Final1.hWindowControl.HalconWindow);
            DrawMode(false);                          //绘制模式关闭

            prepared = true;                          //可以运行
            RunOnce();                                //运行一次
        }
Esempio n. 2
0
        private void btn_DrawCircle_Click(object sender, EventArgs e)
        {
            if (circle == null)
            {
                circle = new Circle();
                data   = circle;
            }

            hWindow_Final1.HobjectToHimage(ho_Image);                                                     //刷新显示区
            DrawMode(true);                                                                               //绘制模式开启
            circle.SetCircle(Func_HalconFunction.DrawCircle(hWindow_Final1.hWindowControl.HalconWindow)); //画圆编辑模式
            DrawMode(false);                                                                              //绘制模式关闭

            getCircleUseThreshold = null;
            nud_Circle_x.Value    = (decimal)circle.hv_Column.D; //赋值
            nud_Circle_y.Value    = (decimal)circle.hv_Row.D;    //赋值
            nud_Radius.Value      = (decimal)circle.hv_Radius.D; //赋值
            prepared = true;                                     //可以运行
            RunOnce();                                           //运行一次
        }