示例#1
0
        /// <summary>
        /// Initializes the image dimension, mouse delegation,
        /// and the graphical context setup of the instance.
        /// </summary>
        /// <param name="hwndctrl"></param>
        public HWndCtrller(HalconDotNet.HWindowControl hwndctrl)
        {
            _hWndCtrl     = hwndctrl;
            _viewMode     = HWndCtrller.VIEW_MODE_NONE;
            _windowWidth  = _hWndCtrl.Size.Width;
            _windowHeight = _hWndCtrl.Size.Height;

            ZoomWndFactor = (double)_imageWidth / _hWndCtrl.Width;
            ZoomAddOn     = System.Math.Pow(0.9, 5);
            _zoomWndSize  = 150;

            _ROIPaintMode = HWndCtrller.PAINT_MODE_INCLUDE_ROI;

            NotifyInfoObserver = new InformationUpdatedDelegate(DummyS);
            IconicUpdatedEvt   = new IconicUpdatedDelegate(OnIconicUpdated);

            /* Graphical Stack */
            _hObjEntityList = new System.Collections.ArrayList(20);
            _grpCntx        = new GraphicContext();
            _grpCntx.NotifyGraphicContext = new GraphicContextDelegate(ExceptionGC);

            _msgLineList     = new System.Collections.Generic.List <Communal.MessageLine>();
            _defaultRowlEdge = 10;
            _rowlEdge        = new HalconDotNet.HTuple();

            /*GUI绘制窗口用参数的初始值*/
            _compRangeX = new int[] { 0, 100 };
            _compRangeY = new int[] { 0, 100 };
            _prevCompX  = _prevCompY = 0;
        }
示例#2
0
        //-------------------------↑公共变量或参数↑--------------------------------------------//

        /// <summary>
        /// Initializes the image dimension, mouse delegation,
        /// and the graphical context setup of the instance.
        /// </summary>
        /// <param name="hwndctrl"></param>
        public HWndCtrller(HalconDotNet.HWindowControl hwndctrl)
        {
            this._hWindowControl = hwndctrl;
            this._viewMode       = MODE_VIEW_NONE;
            this._windowWidth    = this._hWindowControl.Size.Width;
            this._windowHeight   = this._hWindowControl.Size.Height;

            this._zoomWndFactor = (double)this._imageWidth / this._hWindowControl.Width;
            this._zoomAddOn     = System.Math.Pow(0.9, 5);
            this._zoomWndSize   = 150;

            this._ROIDispMode = MODE_INCLUDE_ROI;

            this._hWindowControl.HMouseUp    += new HalconDotNet.HMouseEventHandler(MouseUp);
            this._hWindowControl.HMouseDown  += new HalconDotNet.HMouseEventHandler(MouseDown);
            this._hWindowControl.HMouseMove  += new HalconDotNet.HMouseEventHandler(MouseMove);
            this._hWindowControl.HMouseWheel += new HalconDotNet.HMouseEventHandler(MouseWheel);

            this.NotifyInfo   = new InformationDelegate(DummyS);
            this.NotifyIconic = new IconicDelegate(DummyI);

            /* Graphical Stack */
            this._hObjList = new System.Collections.ArrayList(20);
            this._GC       = new GraphicContext();
            this._GC.NotifyGraphicContext += new GraphicContextDelegate(ExceptionGC);

            /*GUI绘制窗口用参数的初始值*/
            this._compRangeX = new int[] { 0, 100 };
            this._compRangeY = new int[] { 0, 100 };
            this._prevCompX  = this._prevCompY = 0;
        }