コード例 #1
0
        protected internal virtual void InitFieldAndProperty()
        {
            _isCtrlKeyPressed      = false;
            _isAltKeyPressed       = false;
            this.rdbtnNone.Checked = false;
            this.rdbtnNone.Checked = true;

            _ROIManager  = new ProVision.InteractiveROI.ROIManager();
            _HwndCtrller = new ProVision.InteractiveROI.HWndCtrller(this.hWndcDisplay);
            _HwndCtrller.RegisterHwndCtrlMouseEvents();
            _HwndCtrller.SetViewMode(ProVision.InteractiveROI.HWndCtrller.VIEW_MODE_NONE);
            _HwndCtrller.RegisterROICtroller(_ROIManager);
            _ROIManager.SetActiveROISign(ProVision.InteractiveROI.ROIManager.ROI_MODE_POS);

            //引用变量复位
            _hoRawRegion         = null;
            _hoBrushRegion       = null;
            _hoResultRegion      = null;
            _imgWidth            = null;
            _imgHeight           = null;
            _brushColor          = "white";
            _resultRegionColor   = "yellow";
            _selectedRegionColor = "green";

            _isErasingRegion        = false;
            _isErasedRegion         = false;
            _isObtainedResultRegion = false;
            _brushZoomFactor        = 15.0d;
        }
コード例 #2
0
        private void InitFieldAndProperty()
        {
            if (_hwndCtrller == null)
            {
                _hwndCtrller = new ProVision.InteractiveROI.HWndCtrller(this.hwndctrlDisplay);
            }

            if (_roiMgr == null)
            {
                _roiMgr = new ProVision.InteractiveROI.ROIManager();
            }

            _hwndCtrller.RegisterROICtroller(_roiMgr);
            _hwndCtrller.SetViewMode(ProVision.InteractiveROI.HWndCtrller.VIEW_MODE_NONE);
            _hwndCtrller.ChangeGraphicSettings(ProVision.InteractiveROI.GraphicContext.GC_DRAWMODE, "margin");

            _hwndCtrller.RegisterHwndCtrlMouseEvents();
            this.hwndctrlDisplay.HMouseDown += HWndcMain_HMouseDown;
            this.hwndctrlDisplay.Tag         = this.Tag;
        }
コード例 #3
0
        protected internal virtual void InitFieldAndProperty()
        {
            _ROIManager  = new InteractiveROI.ROIManager();
            _hWndCtrller = new InteractiveROI.HWndCtrller(this.hWndcDisplay);
            _hWndCtrller.ChangeGraphicSettings(ProVision.InteractiveROI.GraphicContext.GC_COLOR, new HalconDotNet.HTuple("yellow"));
            _hWndCtrller.ChangeGraphicSettings(ProVision.InteractiveROI.GraphicContext.GC_LINEWIDTH, new HalconDotNet.HTuple(2));

            _hWndCtrller.RegisterROICtroller(_ROIManager);
            _hWndCtrller.RegisterHwndCtrlMouseEvents();

            _matchModelAssistant = new ProVision.MatchModel.ShapeModelAssistant();

            _img                  = new HalconDotNet.HObject();
            _isAutoCalibrate      = false;
            _isGrabbedImage       = false;
            _isCalibrating        = false;
            _isCalibratedOK       = false;
            _positionStep         = 0;
            _angleStep            = 0;
            _isCirclePointUpdated = new bool[] { false, false, false };
        }
コード例 #4
0
        protected virtual void InitFieldAndProperty()
        {
            _isCtrlKeyPressed = false;
            _isAltKeyPressed  = false;

            _isTransmitted = false;
            _isUpdated     = false;
            _isModifying   = false;
            _isModified    = false;

            _hoRawRegion      = null;
            _hoBrushRegion    = null;
            _hoSelectedRegion = null;
            _hoModifiedRegion = null;

            _colorForRawRegion      = "blue";
            _colorForBrushRegion    = "magenta";
            _colorForSelectedRegion = "green";
            _colorForModifiedRegion = "yellow";

            _zoomFactorForBrush = 50;

            _ROIManager = new ProVision.InteractiveROI.ROIManager();
            _ROIManager.SetActiveROISign(ProVision.InteractiveROI.ROIManager.ROI_MODE_POS);

            _HwndCtrller = new ProVision.InteractiveROI.HWndCtrller(this.hwndcDisplay);
            _HwndCtrller.RegisterROICtroller(_ROIManager);
            _HwndCtrller.RegisterHwndCtrlMouseEvents();
            _HwndCtrller.SetViewMode(ProVision.InteractiveROI.HWndCtrller.VIEW_MODE_NONE);

            //设置画模式:边缘/填充
            _HwndCtrller.ChangeGraphicSettings(ProVision.InteractiveROI.GraphicContext.GC_DRAWMODE, "margin");

            //设置区域颜色:蓝色
            _HwndCtrller.ChangeGraphicSettings(ProVision.InteractiveROI.GraphicContext.GC_COLOR, _colorForRawRegion);

            //设置区域线段:1.5
            _HwndCtrller.ChangeGraphicSettings(ProVision.InteractiveROI.GraphicContext.GC_LINEWIDTH, 1.5);
        }