Ejemplo n.º 1
0
        private void OpenVideo(Camera getCamera)
        {
            List <IntPtr> handelList = new List <IntPtr>();
            PictureBox    pb         = new PictureBox()
            {
                BackColor = System.Drawing.Color.Black, Margin = new Padding(3, 0, 3, 0), Dock = DockStyle.Fill
            };                                                                                                                                   //Pink 改为 black 2016-3-3 11:25:18……

            handelList.Add(pb.Handle);
            formHostBig.Child = pb;
            if (gCfg == null)
            {
                gCfg = InfoExchange.Clone(cfg);//InitReadVideoConfig();
            }
            gCfg.CameraList.Clear();
            getCamera.Position = "1";
            gCfg.CameraList.Add(getCamera);
            if (_curVideoController != null)
            {
                _curVideoController.Stop();
                _curVideoController.Close();
            }
            _curVideoController = null;
            System.GC.Collect();
            _curVideoController = new VideoController(new FtpConfig(), gCfg, handelList);
            _curVideoController.OnShowErrMsg += _curVideoController_OnShowErrMsg;
            _curVideoController.Open();
            _curVideoController.Start();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 打开配置文件中的所有视频
        /// </summary>
        private void OpenVideos()
        {
            List <IntPtr> handelList = new List <IntPtr>();

            for (int i = 0; i < cfg.CameraList.Count; i++)
            {
                if (i == 0)
                {
                    videoBig.MouseUp += videoMin_MouseUp;
                    handelList.Add(videoBig.Handle);
                }
                else
                {
                    PictureBox pb = new PictureBox()
                    {
                        BackColor = System.Drawing.Color.Pink, Width = 100, Height = 120, Margin = new Padding(3, 0, 3, 0)
                    };
                    pb.MouseUp += videoMin_MouseUp;
                    handelList.Add(pb.Handle);
                    this.panel2.Controls.Add(pb);
                }
            }
            if (handelList.Count > 0)
            {
                _curVideoController = new VideoController(new FtpConfig(), cfg, handelList);
                _curVideoController.OnShowErrMsg += _curVideoController_OnShowErrMsg;
                _curVideoController.Open();
                _curVideoController.Start();
            }
            PictureBox pb1 = new PictureBox()
            {
                BackColor = System.Drawing.Color.Pink, Width = 100, Height = 120, Margin = new Padding(3, 0, 3, 0)
            };

            pb1.Image = System.Drawing.Image.FromFile(@"D:\work\远程计量\计量改版程序新\Talent.Measure.Solution\Talent.RemoteCarMeasure\Image\CarImage\1.png");
            PictureBox pb2 = new PictureBox()
            {
                BackColor = System.Drawing.Color.Pink, Width = 100, Height = 120, Margin = new Padding(3, 0, 3, 0)
            };

            pb2.Image = System.Drawing.Image.FromFile(@"D:\work\远程计量\计量改版程序新\Talent.Measure.Solution\Talent.RemoteCarMeasure\Image\CarImage\2.png");
            PictureBox pb3 = new PictureBox()
            {
                BackColor = System.Drawing.Color.Pink, Width = 100, Height = 120, Margin = new Padding(3, 0, 3, 0)
            };

            pb3.Image = System.Drawing.Image.FromFile(@"D:\work\远程计量\计量改版程序新\Talent.Measure.Solution\Talent.RemoteCarMeasure\Image\CarImage\3.png");
            PictureBox pb4 = new PictureBox()
            {
                BackColor = System.Drawing.Color.Pink, Width = 100, Height = 120, Margin = new Padding(3, 0, 3, 0)
            };

            pb4.Image = System.Drawing.Image.FromFile(@"D:\work\远程计量\计量改版程序新\Talent.Measure.Solution\Talent.RemoteCarMeasure\Image\CarImage\4.png");
            PictureBox pb5 = new PictureBox()
            {
                BackColor = System.Drawing.Color.Pink, Width = 100, Height = 120, Margin = new Padding(3, 0, 3, 0)
            };

            pb5.Image = System.Drawing.Image.FromFile(@"D:\work\远程计量\计量改版程序新\Talent.Measure.Solution\Talent.RemoteCarMeasure\Image\CarImage\5.png");
            PictureBox pb6 = new PictureBox()
            {
                BackColor = System.Drawing.Color.Pink, Width = 100, Height = 120, Margin = new Padding(3, 0, 3, 0)
            };

            pb6.Image = System.Drawing.Image.FromFile(@"D:\work\远程计量\计量改版程序新\Talent.Measure.Solution\Talent.RemoteCarMeasure\Image\CarImage\6.png");
            this.panel2.Controls.Add(pb1);
            this.panel2.Controls.Add(pb2);
            this.panel2.Controls.Add(pb3);
            this.panel2.Controls.Add(pb4);
            this.panel2.Controls.Add(pb5);
            this.panel2.Controls.Add(pb6);
        }