修改Camera.cs的UpdateImageOnUI方法,创建LastImage的副本并传递给Setting窗口
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
@@ -823,12 +823,16 @@ namespace JoyD.Windows.CS.Toprie
|
|||||||
imageBox.Image = tempImage;
|
imageBox.Image = tempImage;
|
||||||
|
|
||||||
// 步骤5:同步更新检测配置窗口的实时图像属性
|
// 步骤5:同步更新检测配置窗口的实时图像属性
|
||||||
if (tempImage != null)
|
// 创建LastImage的副本并通过UpdateRealTimeImage方法传递给Setting窗口
|
||||||
|
lock (_lastImageLock)
|
||||||
{
|
{
|
||||||
// 创建图像副本以避免线程安全问题
|
if (_lastImage != null)
|
||||||
Image clonedImage = (Image)tempImage.Clone();
|
{
|
||||||
|
// 直接创建LastImage的副本以避免线程安全问题
|
||||||
|
Image lastImageCopy = (Image)_lastImage.Clone();
|
||||||
// 调用Setting窗口的方法更新实时温度图像
|
// 调用Setting窗口的方法更新实时温度图像
|
||||||
Setting.Form.UpdateRealTimeImage(clonedImage);
|
Setting.Form.UpdateRealTimeImage(lastImageCopy);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lastImage != null)
|
if (lastImage != null)
|
||||||
|
|||||||
Reference in New Issue
Block a user