修复检测区颜色不正确的问题

This commit is contained in:
zqm
2026-01-09 10:34:36 +08:00
parent 4b7cbbae90
commit e5855812e9
2 changed files with 7 additions and 4 deletions

View File

@@ -2393,7 +2393,7 @@ namespace JoyD.Windows.CS.Toprie
// 保存检测区配置
csvContent.AppendLine(); // 添加空行
csvContent.AppendLine($"detectionZone,{_detectionZone.X},{_detectionZone.Y},{_detectionZone.Width},{_detectionZone.Height},{_detectionZone.Color.Name}");
csvContent.AppendLine($"detectionZone,{_detectionZone.X},{_detectionZone.Y},{_detectionZone.Width},{_detectionZone.Height},{ColorTranslator.ToHtml(_detectionZone.Color)}");
}
catch (Exception ex)
{

View File

@@ -3568,9 +3568,6 @@ namespace JoyD.Windows.CS
// 更新选中的颜色
_selectedColor = colorDialog.Color;
// 更新按钮图标,显示新选择的颜色
UpdateColorButtonIcon();
// 检测区修改模式下,更新检测区的颜色
if (_isModifyingDetectionZone)
{
@@ -3588,6 +3585,9 @@ namespace JoyD.Windows.CS
}
}
// 更新按钮图标,显示新选择的颜色
UpdateColorButtonIcon();
// 重绘图片区域,显示新颜色的矩形或检测区
picBoxTemp.Invalidate();
}
@@ -5076,6 +5076,8 @@ namespace JoyD.Windows.CS
// 显示修改检测区按钮和颜色选择按钮
btnModifyDetectionZone.Visible = true;
btnSelectColor.Visible = true;
// 更新颜色选择按钮图标,确保显示检测区的颜色
UpdateColorButtonIcon();
}
else
{
@@ -5087,6 +5089,7 @@ namespace JoyD.Windows.CS
_detectionZone.Y = _tempDetectionZone.Y;
_detectionZone.Width = _tempDetectionZone.Width;
_detectionZone.Height = _tempDetectionZone.Height;
_detectionZone.Color = _tempDetectionZone.Color; // 保存检测区颜色
// 恢复叠加层绘制,显示测温区和温差图
CreateRectangleOverlayImage();