示例#1
0
        private void button2_Click(object sender, EventArgs e)
        {
            var s = Settings.Structures.Load();

            s[Selected].ValueMD = numericUpDown1.Value = (decimal)Detects;
            Settings.Structures.Save(s);
            set = Settings.Structures.Load()[Selected];
        }
示例#2
0
        private void button1_Click(object sender, EventArgs e)
        {
            var s = Settings.Structures.Load();

            s[Selected].ValueMD = numericUpDown1.Value;
            Settings.Structures.Save(s);
            set            = Settings.Structures.Load()[Selected];
            panel1.Visible = false;
        }
示例#3
0
        public CV(uint Selected)
        {
            InitializeComponent();
            this.Selected = Selected;
            set           = Settings.Structures.Load()[Selected];

            p = set.ZoneDetect;

            md = new MootionDetect(set.GetRTSPSecondONVIF);
            //md = new MootionDetect("C:\\Users\\Лехап\\Desktop\\Барсик\\P191202_170012_171018.264.h264_ff.mp4");
            md.OnMD += (long s, Mat image, long m) => { im.Image = image; if (s != default(double))
                                                        {
                                                            Detect(s); Detects = s;
                                                        }
            };

            im.Location       = new Point(0, 0);
            im.Dock           = System.Windows.Forms.DockStyle.Fill;
            im.Size           = this.ClientSize;
            im.SizeMode       = PictureBoxSizeMode.StretchImage;
            im.FunctionalMode = ImageBox.FunctionalModeOption.Minimum;

            md.Zone = p;

            im.MouseDown += (object sender, MouseEventArgs e) => { if (e.Button == MouseButtons.Right)
                                                                   {
                                                                       p = new Rectangle(e.Location, new Size(0, 0));
                                                                   }
            };
            im.MouseMove += (object sender, MouseEventArgs e) =>
            {
                if (e.Button == MouseButtons.Right)
                {
                    p.Size = new Size(Math.Abs(p.X - e.X), Math.Abs(p.Y - e.Y));
                    im.CreateGraphics().DrawRectangle(new Pen(Brushes.Blue, 3f), p);
                    NoDetect = false;
                }
            };
            im.MouseUp += (object sender, MouseEventArgs e) => {
                if (e.Button == MouseButtons.Right)
                {
                    md.Zone = p;
                    //im.CreateGraphics().Clear(Color.Gray);
                    var s = Settings.Structures.Load();
                    s[Selected].ZoneDetect = p;
                    Settings.Structures.Save(s);
                    set = Settings.Structures.Load()[Selected];
                }
            };
            im.Invalidated += (object sender, InvalidateEventArgs e) => im.CreateGraphics().DrawRectangle(new Pen(Brushes.Blue, 3f), p);
        }