diff --git a/Windows/CS/Framework4.0/Toprie/Toprie/Setting.cs b/Windows/CS/Framework4.0/Toprie/Toprie/Setting.cs index 207ded8..183ed4e 100644 --- a/Windows/CS/Framework4.0/Toprie/Toprie/Setting.cs +++ b/Windows/CS/Framework4.0/Toprie/Toprie/Setting.cs @@ -1224,6 +1224,8 @@ namespace JoyD.Windows.CS { try { + Color colorToRemove = Color.Empty; + // 检查是否有选中的行 if (dataGridViewTempDiff.SelectedRows.Count > 0) { @@ -1233,6 +1235,9 @@ namespace JoyD.Windows.CS // 从数据集合中删除该行数据 if (selectedRowIndex >= 0 && selectedRowIndex < tempDiffData.Count) { + // 获取要删除的图例对应的颜色 + colorToRemove = (Color)tempDiffData[selectedRowIndex]["color"]; + tempDiffData.RemoveAt(selectedRowIndex); // 从DataGridView中删除该行 dataGridViewTempDiff.Rows.RemoveAt(selectedRowIndex); @@ -1247,11 +1252,21 @@ namespace JoyD.Windows.CS // 从数据集合中删除该行数据 if (currentRowIndex >= 0 && currentRowIndex < tempDiffData.Count) { + // 获取要删除的图例对应的颜色 + colorToRemove = (Color)tempDiffData[currentRowIndex]["color"]; + tempDiffData.RemoveAt(currentRowIndex); // 从DataGridView中删除该行 dataGridViewTempDiff.Rows.RemoveAt(currentRowIndex); } } + + // 将温差层中对应颜色的像素改为透明色 + if (colorToRemove != Color.Empty && _tempDiffOverlayImage != null) + { + UpdateTempDiffOverlayPixelsColor(colorToRemove, Color.Transparent); + picBoxTemp.Invalidate(); // 刷新显示 + } } catch (Exception ex) {