Esempio n. 1
0
        public void DeleteZone(OrionRecognizeZone Zone)
        {
            this.NsOCR.Img_DeleteBlock(ImgObj, Zone.BlkObj);
            var zn = this.ListZoneName.FirstOrDefault <OrionRecognizeZoneDetail>(x => x.BlkObj == Zone.BlkObj);

            if (zn != null)
            {
                this.ListZoneName.Remove(zn);
            }
            Zone = null;
        }
Esempio n. 2
0
        public void UpdateZone(OrionRecognizeZone Zone)
        {
            this.NsOCR.Blk_SetRect(
                Zone.BlkObj,
                Zone.X,
                Zone.Y,
                Zone.Width,
                Zone.Height
                );
            var orz = this.ListZoneName.FirstOrDefault <OrionRecognizeZoneDetail>(x => x.BlkObj == Zone.BlkObj);

            if (orz != null)
            {
                orz.Name = Zone.Name;
                orz.ID   = Zone.ID;
            }
        }
        public F_ConfigZone(ImageBoxRecognize ImageBoxRecognize, OrionRecognizeZone OrionRecognizeZone)
        {
            InitializeComponent();
            this._OrionRecognizeZone = OrionRecognizeZone;
            this._ImageBoxRecognize  = ImageBoxRecognize;

            this.tbName.DataBindings.Add("Text", this._OrionRecognizeZone, "Name");
            this.nudX.DataBindings.Add("Value", this._OrionRecognizeZone, "X");
            this.nudY.DataBindings.Add("Value", this._OrionRecognizeZone, "Y");
            this.nudWidth.DataBindings.Add("Value", this._OrionRecognizeZone, "Width");
            this.nudHeight.DataBindings.Add("Value", this._OrionRecognizeZone, "Height");

            this.nudX.ValueChanged      += nudX_ValueChanged;
            this.nudY.ValueChanged      += nudX_ValueChanged;
            this.nudWidth.ValueChanged  += nudX_ValueChanged;
            this.nudHeight.ValueChanged += nudX_ValueChanged;
        }
Esempio n. 4
0
        protected override void OnMouseClick(MouseEventArgs e)
        {
            base.OnMouseClick(e);
            if (e.Button == System.Windows.Forms.MouseButtons.Right)
            {
                var pos = MousePositionInImage(e);
                //var pos = e.Location;

                int index = -1;
                var Zones = this._OrionRecognize.GetZones();
                foreach (var Zone in Zones)
                {
                    index++;
                    if (pos.X >= Zone.X && pos.Y >= Zone.Y && pos.X <= (Zone.X + Zone.Width) && pos.Y <= (Zone.Y + Zone.Height))
                    {
                        this.ZoneSelected = Zone;
                        this._MenuStrip.Show(Control.MousePosition.X, Control.MousePosition.Y);
                        break;
                    }
                }
            }
        }
Esempio n. 5
0
 void fg_FormClosed(object sender, FormClosedEventArgs e)
 {
     this.Invalidate();
     this.ZoneSelected = null;
 }