Exemplo n.º 1
0
        /// <summary> 
        /// Initializes the image dimension, mouse delegation, and the 
        /// graphical context setup of the instance.
        /// </summary>
        /// <param name="view"> HALCON window </param>
        public HWndCtrl(HWindowControl view)
        {
            _viewPort = view;
            _stateView = MODE_VIEW_NONE;
            windowWidth = _viewPort.Size.Width;
            windowHeight = _viewPort.Size.Height;

            zoomWndFactor = (double)imageWidth / _viewPort.Width;
            zoomAddOn = Math.Pow(0.9, 5);
            zoomWndSize = 150;

            /*default*/
            CompRangeX = new int[] { 0, 100 };
            CompRangeY = new int[] { 0, 100 };

            prevCompX = prevCompY = 0;

            _dispROI = MODE_INCLUDE_ROI;//1;

            _viewPort.HMouseUp += new HalconDotNet.HMouseEventHandler(this.mouseUp);
            _viewPort.HMouseDown += new HalconDotNet.HMouseEventHandler(this.mouseDown);
            _viewPort.HMouseMove += new HalconDotNet.HMouseEventHandler(this.mouseMoved);

            addInfoDelegate = new FuncDelegate(dummyV);
            NotifyIconObserver = new IconicDelegate(dummy);

            // graphical stack
            HObjList = new ArrayList(20);
            mGC = new GraphicsContext();
            mGC.gcNotification = new GCDelegate(exceptionGC);
        }