// Add new camera to the collection and run it public bool Add(CameraPlay camwin, DeviceInfo deviceInfo, CameraInfo camera) { // create video source IVideoSource videoSource= DeviceBusiness.Instance.CreateVideoSource(deviceInfo.ProviderName); if (videoSource == null) { return false; } DeviceDriver device = new DeviceDriver(videoSource); if (!RunningDeviceList.ContainsKey(deviceInfo.DeviceId)) { deviceInfo.ServiceID = -1; device.Init(ref deviceInfo); RunningDeviceList.Add(deviceInfo.DeviceId, deviceInfo); RunningDriverList.Add(camera.CameraId, device); } else { deviceInfo = RunningDeviceList[deviceInfo.DeviceId]; device.Init(ref deviceInfo); RunningDriverList.Add(camera.CameraId, device); } device.Start(ref camera); camwin.Camera = device; return true; }
private void SetClickON(CameraPlay cameraPlay) { string winName = "cameraPlay"; for (int i = 0; i < 25; i++) { Control[] control = this.Controls.Find(string.Format("{0}{1}", winName, i), false); if (control != null && control.Length > 0) { CameraPlay ctr = (CameraPlay)control[0]; if (ctr != null) { ctr.ClickMe = false; } } } cameraPlay.ClickMe = true; }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.cameraPlay1 = new CameraViewer.Controls.CameraPlay(); this.cameraPlay2 = new CameraViewer.Controls.CameraPlay(); this.cameraPlay3 = new CameraViewer.Controls.CameraPlay(); this.cameraPlay4 = new CameraViewer.Controls.CameraPlay(); this.cameraPlay5 = new CameraViewer.Controls.CameraPlay(); this.cameraPlay6 = new CameraViewer.Controls.CameraPlay(); this.cameraPlay7 = new CameraViewer.Controls.CameraPlay(); this.cameraPlay8 = new CameraViewer.Controls.CameraPlay(); this.cameraPlay9 = new CameraViewer.Controls.CameraPlay(); this.cameraPlay10 = new CameraViewer.Controls.CameraPlay(); this.cameraPlay11 = new CameraViewer.Controls.CameraPlay(); this.cameraPlay12 = new CameraViewer.Controls.CameraPlay(); this.cameraPlay13 = new CameraViewer.Controls.CameraPlay(); this.cameraPlay14 = new CameraViewer.Controls.CameraPlay(); this.cameraPlay15 = new CameraViewer.Controls.CameraPlay(); this.cameraPlay16 = new CameraViewer.Controls.CameraPlay(); this.cameraPlay17 = new CameraViewer.Controls.CameraPlay(); this.cameraPlay18 = new CameraViewer.Controls.CameraPlay(); this.cameraPlay19 = new CameraViewer.Controls.CameraPlay(); this.cameraPlay20 = new CameraViewer.Controls.CameraPlay(); this.cameraPlay21 = new CameraViewer.Controls.CameraPlay(); this.cameraPlay22 = new CameraViewer.Controls.CameraPlay(); this.cameraPlay23 = new CameraViewer.Controls.CameraPlay(); this.cameraPlay24 = new CameraViewer.Controls.CameraPlay(); this.cameraPlay25 = new CameraViewer.Controls.CameraPlay(); this.SuspendLayout(); // // cameraPlay1 // this.cameraPlay1.Camera = null; this.cameraPlay1.ClickMe = false; this.cameraPlay1.Location = new System.Drawing.Point(0, 0); this.cameraPlay1.Name = "cameraPlay1"; this.cameraPlay1.Size = new System.Drawing.Size(266, 182); this.cameraPlay1.TabIndex = 0; this.cameraPlay1.ClickVideo += new System.EventHandler(this.cameraPlay_Click); this.cameraPlay1.DoubleClickVideo += new System.EventHandler(this.cameraPlay_DoubleClickVideo); // // cameraPlay2 // this.cameraPlay2.Camera = null; this.cameraPlay2.ClickMe = false; this.cameraPlay2.Location = new System.Drawing.Point(0, 0); this.cameraPlay2.Name = "cameraPlay2"; this.cameraPlay2.Size = new System.Drawing.Size(266, 182); this.cameraPlay2.TabIndex = 0; this.cameraPlay2.ClickVideo += new System.EventHandler(this.cameraPlay_Click); this.cameraPlay2.DoubleClickVideo += new System.EventHandler(this.cameraPlay_DoubleClickVideo); // // cameraPlay3 // this.cameraPlay3.Camera = null; this.cameraPlay3.ClickMe = false; this.cameraPlay3.Location = new System.Drawing.Point(0, 0); this.cameraPlay3.Name = "cameraPlay3"; this.cameraPlay3.Size = new System.Drawing.Size(266, 182); this.cameraPlay3.TabIndex = 0; this.cameraPlay3.ClickVideo += new System.EventHandler(this.cameraPlay_Click); this.cameraPlay3.DoubleClickVideo += new System.EventHandler(this.cameraPlay_DoubleClickVideo); // // cameraPlay4 // this.cameraPlay4.Camera = null; this.cameraPlay4.ClickMe = false; this.cameraPlay4.Location = new System.Drawing.Point(0, 0); this.cameraPlay4.Name = "cameraPlay4"; this.cameraPlay4.Size = new System.Drawing.Size(266, 182); this.cameraPlay4.TabIndex = 0; this.cameraPlay4.ClickVideo += new System.EventHandler(this.cameraPlay_Click); this.cameraPlay4.DoubleClickVideo += new System.EventHandler(this.cameraPlay_DoubleClickVideo); // // cameraPlay5 // this.cameraPlay5.Camera = null; this.cameraPlay5.ClickMe = false; this.cameraPlay5.Location = new System.Drawing.Point(0, 0); this.cameraPlay5.Name = "cameraPlay5"; this.cameraPlay5.Size = new System.Drawing.Size(266, 182); this.cameraPlay5.TabIndex = 0; this.cameraPlay5.ClickVideo += new System.EventHandler(this.cameraPlay_Click); this.cameraPlay5.DoubleClickVideo += new System.EventHandler(this.cameraPlay_DoubleClickVideo); // // cameraPlay6 // this.cameraPlay6.Camera = null; this.cameraPlay6.ClickMe = false; this.cameraPlay6.Location = new System.Drawing.Point(0, 0); this.cameraPlay6.Name = "cameraPlay6"; this.cameraPlay6.Size = new System.Drawing.Size(266, 182); this.cameraPlay6.TabIndex = 0; this.cameraPlay6.ClickVideo += new System.EventHandler(this.cameraPlay_Click); this.cameraPlay6.DoubleClickVideo += new System.EventHandler(this.cameraPlay_DoubleClickVideo); // // cameraPlay7 // this.cameraPlay7.Camera = null; this.cameraPlay7.ClickMe = false; this.cameraPlay7.Location = new System.Drawing.Point(0, 0); this.cameraPlay7.Name = "cameraPlay7"; this.cameraPlay7.Size = new System.Drawing.Size(266, 182); this.cameraPlay7.TabIndex = 0; this.cameraPlay7.ClickVideo += new System.EventHandler(this.cameraPlay_Click); this.cameraPlay7.DoubleClickVideo += new System.EventHandler(this.cameraPlay_DoubleClickVideo); // // cameraPlay8 // this.cameraPlay8.Camera = null; this.cameraPlay8.ClickMe = false; this.cameraPlay8.Location = new System.Drawing.Point(0, 0); this.cameraPlay8.Name = "cameraPlay8"; this.cameraPlay8.Size = new System.Drawing.Size(266, 182); this.cameraPlay8.TabIndex = 0; this.cameraPlay8.ClickVideo += new System.EventHandler(this.cameraPlay_Click); this.cameraPlay8.DoubleClickVideo += new System.EventHandler(this.cameraPlay_DoubleClickVideo); // // cameraPlay9 // this.cameraPlay9.Camera = null; this.cameraPlay9.ClickMe = false; this.cameraPlay9.Location = new System.Drawing.Point(0, 0); this.cameraPlay9.Name = "cameraPlay9"; this.cameraPlay9.Size = new System.Drawing.Size(266, 182); this.cameraPlay9.TabIndex = 0; this.cameraPlay9.ClickVideo += new System.EventHandler(this.cameraPlay_Click); this.cameraPlay9.DoubleClickVideo += new System.EventHandler(this.cameraPlay_DoubleClickVideo); // // cameraPlay10 // this.cameraPlay10.Camera = null; this.cameraPlay10.ClickMe = false; this.cameraPlay10.Location = new System.Drawing.Point(0, 0); this.cameraPlay10.Name = "cameraPlay10"; this.cameraPlay10.Size = new System.Drawing.Size(266, 182); this.cameraPlay10.TabIndex = 0; this.cameraPlay10.ClickVideo += new System.EventHandler(this.cameraPlay_Click); this.cameraPlay10.DoubleClickVideo += new System.EventHandler(this.cameraPlay_DoubleClickVideo); // // cameraPlay11 // this.cameraPlay11.Camera = null; this.cameraPlay11.ClickMe = false; this.cameraPlay11.Location = new System.Drawing.Point(0, 0); this.cameraPlay11.Name = "cameraPlay11"; this.cameraPlay11.Size = new System.Drawing.Size(266, 182); this.cameraPlay11.TabIndex = 0; this.cameraPlay11.ClickVideo += new System.EventHandler(this.cameraPlay_Click); this.cameraPlay11.DoubleClickVideo += new System.EventHandler(this.cameraPlay_DoubleClickVideo); // // cameraPlay12 // this.cameraPlay12.Camera = null; this.cameraPlay12.ClickMe = false; this.cameraPlay12.Location = new System.Drawing.Point(0, 0); this.cameraPlay12.Name = "cameraPlay12"; this.cameraPlay12.Size = new System.Drawing.Size(266, 182); this.cameraPlay12.TabIndex = 0; this.cameraPlay12.ClickVideo += new System.EventHandler(this.cameraPlay_Click); this.cameraPlay12.DoubleClickVideo += new System.EventHandler(this.cameraPlay_DoubleClickVideo); // // cameraPlay13 // this.cameraPlay13.Camera = null; this.cameraPlay13.ClickMe = false; this.cameraPlay13.Location = new System.Drawing.Point(0, 0); this.cameraPlay13.Name = "cameraPlay13"; this.cameraPlay13.Size = new System.Drawing.Size(266, 182); this.cameraPlay13.TabIndex = 0; this.cameraPlay13.ClickVideo += new System.EventHandler(this.cameraPlay_Click); this.cameraPlay13.DoubleClickVideo += new System.EventHandler(this.cameraPlay_DoubleClickVideo); // // cameraPlay14 // this.cameraPlay14.Camera = null; this.cameraPlay14.ClickMe = false; this.cameraPlay14.Location = new System.Drawing.Point(0, 0); this.cameraPlay14.Name = "cameraPlay14"; this.cameraPlay14.Size = new System.Drawing.Size(266, 182); this.cameraPlay14.TabIndex = 0; this.cameraPlay14.ClickVideo += new System.EventHandler(this.cameraPlay_Click); this.cameraPlay14.DoubleClickVideo += new System.EventHandler(this.cameraPlay_DoubleClickVideo); // // cameraPlay15 // this.cameraPlay15.Camera = null; this.cameraPlay15.ClickMe = false; this.cameraPlay15.Location = new System.Drawing.Point(0, 0); this.cameraPlay15.Name = "cameraPlay15"; this.cameraPlay15.Size = new System.Drawing.Size(266, 182); this.cameraPlay15.TabIndex = 0; this.cameraPlay15.ClickVideo += new System.EventHandler(this.cameraPlay_Click); this.cameraPlay15.DoubleClickVideo += new System.EventHandler(this.cameraPlay_DoubleClickVideo); // // cameraPlay16 // this.cameraPlay16.Camera = null; this.cameraPlay16.ClickMe = false; this.cameraPlay16.Location = new System.Drawing.Point(0, 0); this.cameraPlay16.Name = "cameraPlay16"; this.cameraPlay16.Size = new System.Drawing.Size(266, 182); this.cameraPlay16.TabIndex = 0; this.cameraPlay16.ClickVideo += new System.EventHandler(this.cameraPlay_Click); this.cameraPlay16.DoubleClickVideo += new System.EventHandler(this.cameraPlay_DoubleClickVideo); // // cameraPlay17 // this.cameraPlay17.Camera = null; this.cameraPlay17.ClickMe = false; this.cameraPlay17.Location = new System.Drawing.Point(0, 0); this.cameraPlay17.Name = "cameraPlay17"; this.cameraPlay17.Size = new System.Drawing.Size(266, 182); this.cameraPlay17.TabIndex = 0; this.cameraPlay17.ClickVideo += new System.EventHandler(this.cameraPlay_Click); this.cameraPlay17.DoubleClickVideo += new System.EventHandler(this.cameraPlay_DoubleClickVideo); // // cameraPlay18 // this.cameraPlay18.Camera = null; this.cameraPlay18.ClickMe = false; this.cameraPlay18.Location = new System.Drawing.Point(0, 0); this.cameraPlay18.Name = "cameraPlay18"; this.cameraPlay18.Size = new System.Drawing.Size(266, 182); this.cameraPlay18.TabIndex = 0; this.cameraPlay18.ClickVideo += new System.EventHandler(this.cameraPlay_Click); this.cameraPlay18.DoubleClickVideo += new System.EventHandler(this.cameraPlay_DoubleClickVideo); // // cameraPlay19 // this.cameraPlay19.Camera = null; this.cameraPlay19.ClickMe = false; this.cameraPlay19.Location = new System.Drawing.Point(0, 0); this.cameraPlay19.Name = "cameraPlay19"; this.cameraPlay19.Size = new System.Drawing.Size(266, 182); this.cameraPlay19.TabIndex = 0; this.cameraPlay19.ClickVideo += new System.EventHandler(this.cameraPlay_Click); this.cameraPlay19.DoubleClickVideo += new System.EventHandler(this.cameraPlay_DoubleClickVideo); // // cameraPlay20 // this.cameraPlay20.Camera = null; this.cameraPlay20.ClickMe = false; this.cameraPlay20.Location = new System.Drawing.Point(0, 0); this.cameraPlay20.Name = "cameraPlay20"; this.cameraPlay20.Size = new System.Drawing.Size(266, 182); this.cameraPlay20.TabIndex = 0; this.cameraPlay20.ClickVideo += new System.EventHandler(this.cameraPlay_Click); this.cameraPlay20.DoubleClickVideo += new System.EventHandler(this.cameraPlay_DoubleClickVideo); // // cameraPlay21 // this.cameraPlay21.Camera = null; this.cameraPlay21.ClickMe = false; this.cameraPlay21.Location = new System.Drawing.Point(0, 0); this.cameraPlay21.Name = "cameraPlay21"; this.cameraPlay21.Size = new System.Drawing.Size(266, 182); this.cameraPlay21.TabIndex = 0; this.cameraPlay21.ClickVideo += new System.EventHandler(this.cameraPlay_Click); this.cameraPlay21.DoubleClickVideo += new System.EventHandler(this.cameraPlay_DoubleClickVideo); // // cameraPlay22 // this.cameraPlay22.Camera = null; this.cameraPlay22.ClickMe = false; this.cameraPlay22.Location = new System.Drawing.Point(0, 0); this.cameraPlay22.Name = "cameraPlay22"; this.cameraPlay22.Size = new System.Drawing.Size(266, 182); this.cameraPlay22.TabIndex = 0; this.cameraPlay22.ClickVideo += new System.EventHandler(this.cameraPlay_Click); this.cameraPlay22.DoubleClickVideo += new System.EventHandler(this.cameraPlay_DoubleClickVideo); // // cameraPlay23 // this.cameraPlay23.Camera = null; this.cameraPlay23.ClickMe = false; this.cameraPlay23.Location = new System.Drawing.Point(0, 0); this.cameraPlay23.Name = "cameraPlay23"; this.cameraPlay23.Size = new System.Drawing.Size(266, 182); this.cameraPlay23.TabIndex = 0; this.cameraPlay23.ClickVideo += new System.EventHandler(this.cameraPlay_Click); this.cameraPlay23.DoubleClickVideo += new System.EventHandler(this.cameraPlay_DoubleClickVideo); // // cameraPlay24 // this.cameraPlay24.Camera = null; this.cameraPlay24.ClickMe = false; this.cameraPlay24.Location = new System.Drawing.Point(0, 0); this.cameraPlay24.Name = "cameraPlay24"; this.cameraPlay24.Size = new System.Drawing.Size(266, 182); this.cameraPlay24.TabIndex = 0; this.cameraPlay24.ClickVideo += new System.EventHandler(this.cameraPlay_Click); this.cameraPlay24.DoubleClickVideo += new System.EventHandler(this.cameraPlay_DoubleClickVideo); // // cameraPlay25 // this.cameraPlay25.Camera = null; this.cameraPlay25.ClickMe = false; this.cameraPlay25.Location = new System.Drawing.Point(0, 0); this.cameraPlay25.Name = "cameraPlay25"; this.cameraPlay25.Size = new System.Drawing.Size(266, 182); this.cameraPlay25.TabIndex = 0; this.cameraPlay25.ClickVideo += new System.EventHandler(this.cameraPlay_Click); this.cameraPlay25.DoubleClickVideo += new System.EventHandler(this.cameraPlay_DoubleClickVideo); // // Multiplayer // this.Size = new System.Drawing.Size(424, 376); this.Paint += new System.Windows.Forms.PaintEventHandler(this.Multiplayer_Paint); this.Click += new System.EventHandler(this.cameraPlay_Click); this.Resize += new System.EventHandler(this.Multiplexer_Resize); this.ResumeLayout(false); }
// On mouse down in camera window private void cameraPlay_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) { lastClicked = (CameraPlay)sender; }
private void cameraPlay_DoubleClickVideo(object sender, EventArgs e) { try { if (!isFullScreen) { SingleCameraMode = true; FitToWindow = true; currentWin = lastClicked; } else { SingleCameraMode = false; currentWin.ClickMe = true; } doubleClicked = (CameraPlay)sender; if (DoubleCamera != null) { DoubleCamera(!isFullScreen, currentWin.Camera.CurrentCamera); } isFullScreen = !isFullScreen; UpdateSize(); } catch (Exception ex) { } }