Beispiel #1
0
        /// <summary>
        /// Sets the view mode for mouse events in the HALCON window
        /// (zoom, move, magnify or none).
        /// </summary>
        /// <param name="mode">One of the MODE_VIEW_* constants</param>
        public void setViewState(int mode)
        {
            stateView = mode;

            if (roiManager != null)
            {
                roiManager.resetROI();
            }
        }
        /// <summary>
        /// Sets the view mode for mouse events in the HALCON window
        /// (zoom, move, magnify or none).
        /// </summary>
        /// <param name="mode">One of the MODE_VIEW_* constants</param>
        public void setViewState(int mode)
        {
            if (_stateView == HWndCtrl.MODE_VIEW_ZOOMCONTINUE)
            {
                if (ZoomWindow != null)
                {
                    ZoomWindow.Dispose();
                }
            }
            _stateView = mode;
            if (_roiManager != null)
            {
                _roiManager.resetROI();
            }
            if (On_OperationModeChanged != null)
            {
                var modeText = "";
                switch (mode)
                {
                case HWndCtrl.MODE_VIEW_NONE:
                    modeText = "ImageNone";
                    break;

                case HWndCtrl.MODE_VIEW_MOVE:
                    modeText = "ImageMove";
                    break;

                case HWndCtrl.MODE_VIEW_ZOOM:
                    modeText = "ImageZoom";
                    break;

                case HWndCtrl.MODE_VIEW_ZOOMWINDOW:
                    modeText = "ImageManigify";
                    break;
                }
                On_OperationModeChanged(modeText);
            }
        }