Пример #1
0
        /// <summary>
        /// Repaints the HALCON window 'window'
        /// </summary>
        public void repaint(HalconDotNet.HWindow window)
        {
            int          count = HObjList.Count;
            HObjectEntry entry;

            HSystem.SetSystem("flush_graphic", "false");
            window.ClearWindow();
            mGC.stateOfSettings.Clear();

            for (int i = 0; i < count; i++)
            {
                entry = ((HObjectEntry)HObjList[i]);
                mGC.applyContext(window, entry.gContext);
                window.DispObj(entry.HObj);
            }

            addInfoDelegate();

            if (roiManager != null && (dispROI == MODE_INCLUDE_ROI))
            {
                roiManager.paintData(window);
            }

            HSystem.SetSystem("flush_graphic", "true");

            window.SetColor("black");
            window.DispLine(-100.0, -100.0, -101.0, -101.0);
        }
Пример #2
0
        /// <summary>
        /// Repaints the HALCON window 'window'
        /// </summary>
        public void repaint(HalconDotNet.HWindow window)
        {
            try
            {
                int          count = HObjImageList.Count;
                HObjectEntry entry;

                HSystem.SetSystem("flush_graphic", "false");
                window.ClearWindow();
                mGC.stateOfSettings.Clear();

                //显示图片
                for (int i = 0; i < count; i++)
                {
                    entry = ((HObjectEntry)HObjImageList[i]);
                    mGC.applyContext(window, entry.gContext);
                    window.DispObj(entry.HObj);
                }

                //显示region
                showHObjectList();


                addInfoDelegate();

                if (roiManager != null && (dispROI == MODE_INCLUDE_ROI))
                {
                    roiManager.paintData(window);
                }


                HSystem.SetSystem("flush_graphic", "true");

                //注释了下面语句,会导致窗口无法实现缩放和拖动
                window.SetColor("black");
                window.DispLine(-100.0, -100.0, -101.0, -101.0);
            }
            catch (Exception)
            {
            }
        }