Exemplo n.º 1
0
        private void MouseMovePoint(object sender, MouseEventArgs e)
        {
            int state;

            try
            {
                mView.viewPort.HalconWindow.GetMpositionSubPix(out row, out col, out state);
                txt_Row.Text = string.Format("{0:F3}", row);
                txt_Col.Text = string.Format("{0:F3}", col);
                if (modelPointXld == null)
                {
                    modelPointXld = new HXLDCont();
                }
                if (modelPointXld != null && modelPointXld.IsInitialized())
                {
                    modelPointXld.Dispose();
                }
                modelPointXld.GenCrossContourXld(row, col, 30, 0);
                HXLDCont CicleXld = new HXLDCont();
                CicleXld.GenCircleContourXld(row, col, 50, 0, 2 * Math.PI, "positive", 2);
                HXLDCont temp = new HXLDCont();
                temp = modelPointXld.ConcatObj(CicleXld);
                modelPointXld.Dispose();
                modelPointXld = temp;
                mView.ClearList();
                mView.SetDispLevel(ShowMode.ExcludeROI);
                mView.ChangeGraphicSettings(Mode.LINESTYLE, new HTuple());
                mView.AddIconicVar(tool.ModelImage);
                if (modelPointXld != null)
                {
                    mView.ChangeGraphicSettings(Mode.COLOR, "red");
                    mView.ChangeGraphicSettings(Mode.LINEWIDTH, 2);
                    mView.AddIconicVar(modelPointXld);
                }
                mView.Repaint();
            }

            catch (HalconException)
            {
                return;
            }
        }