diff --git a/Windows/CS/Framework4.0/Camera/Camera/Setting.Designer.cs b/Windows/CS/Framework4.0/Camera/Camera/Setting.Designer.cs index 663eabd..8348f68 100644 --- a/Windows/CS/Framework4.0/Camera/Camera/Setting.Designer.cs +++ b/Windows/CS/Framework4.0/Camera/Camera/Setting.Designer.cs @@ -32,6 +32,7 @@ namespace Camera this.toolStripNumericUpDown5 = new ToolStripNumericUpDown(); this.toolStripLabel6 = new System.Windows.Forms.ToolStripLabel(); this.toolStripNumericUpDown6 = new ToolStripNumericUpDown(); + this.toolStripButton5 = new System.Windows.Forms.ToolStripButton(); this.toolStripLabel1 = new System.Windows.Forms.ToolStripLabel(); this.toolStripNumericUpDown1 = new ToolStripNumericUpDown(); this.toolStripLabel2 = new System.Windows.Forms.ToolStripLabel(); @@ -216,7 +217,8 @@ namespace Camera this.toolStripLabel5, this.toolStripNumericUpDown5, this.toolStripLabel6, - this.toolStripNumericUpDown6}); + this.toolStripNumericUpDown6, + this.toolStripButton5}); this.toolStrip3.Name = "toolStrip3"; this.toolStrip3.Size = new System.Drawing.Size(559, 30); this.toolStrip3.TabIndex = 2; @@ -309,6 +311,15 @@ namespace Camera 0, 0}); // + // toolStripButton5 + // + this.toolStripButton5.Checked = true; + this.toolStripButton5.CheckOnClick = true; + this.toolStripButton5.Name = "toolStripButton5"; + this.toolStripButton5.Size = new System.Drawing.Size(100, 27); + this.toolStripButton5.Text = "显示Led框"; + this.toolStripButton5.Click += new System.EventHandler(this.ToolStripButton5_Click); + // // toolStripLabel7 // this.toolStripLabel7.Name = "toolStripLabel7"; @@ -733,6 +744,7 @@ namespace Camera private System.Windows.Forms.ToolStripLabel toolStripLabel11; private ToolStripNumericUpDown toolStripNumericUpDown11; private ToolStripNumericUpDown toolStripNumericUpDown12; + private System.Windows.Forms.ToolStripButton toolStripButton5; private System.Windows.Forms.DataGridView dataGridView1; private System.Windows.Forms.SplitContainer splitContainer2; private System.Windows.Forms.DataGridView dataGridView2; diff --git a/Windows/CS/Framework4.0/Camera/Camera/Setting.cs b/Windows/CS/Framework4.0/Camera/Camera/Setting.cs index 316fcb4..777ec4e 100644 --- a/Windows/CS/Framework4.0/Camera/Camera/Setting.cs +++ b/Windows/CS/Framework4.0/Camera/Camera/Setting.cs @@ -132,6 +132,7 @@ namespace Camera private bool _isEditingLedZone = false; private bool _isDrawingLedMode = false; private int _ledZoneState = 0; + private bool _showLedZones = true; private Color _detectionZoneColor = Color.Black; private ConcurrentDictionary _ledZoneColors = new ConcurrentDictionary(); private ConcurrentDictionary _ledZoneDetectionResults = new ConcurrentDictionary(); @@ -381,6 +382,7 @@ namespace Camera var hsvValues = _camera.GetLedZoneHsvValues(); foreach (var kvp in allLedZones) { + if (!_showLedZones) continue; int index = kvp.Key; Rectangle ledZone = kvp.Value; Color ledColor = _camera.GetLedZoneColor(index); @@ -1705,6 +1707,13 @@ namespace Camera _camera.SetLedDetectorParams(brightLimit, satLimit); } + // 显示Led框复选框事件 + private void ToolStripButton5_Click(object sender, EventArgs e) + { + _showLedZones = toolStripButton5.Checked; + picBoxCamera.Invalidate(); + } + // 红绿蓝阈值事件 private void ToolStripNumericUpDown7_ValueChanged(object sender, EventArgs e) {