隐藏Led框

This commit is contained in:
zqm
2026-03-27 15:05:05 +08:00
parent 1ef0fd4c06
commit 66d40a0a6a
2 changed files with 22 additions and 1 deletions

View File

@@ -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;

View File

@@ -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<int, Color> _ledZoneColors = new ConcurrentDictionary<int, Color>();
private ConcurrentDictionary<int, string> _ledZoneDetectionResults = new ConcurrentDictionary<int, string>();
@@ -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)
{