实现外部图像只放在mRealTimeImage中,由定时器负责UI更新的功能
This commit is contained in:
@@ -107,8 +107,6 @@ namespace JoyD.Windows.CS
|
||||
{
|
||||
get
|
||||
{
|
||||
if (DesignMode || this.IsDisposed || this.Disposing || pictureBoxTemperatureDisplay == null || pictureBoxTemperatureDisplay.IsDisposed)
|
||||
return null;
|
||||
return mRealTimeImage;
|
||||
}
|
||||
set
|
||||
@@ -133,7 +131,7 @@ namespace JoyD.Windows.CS
|
||||
return;
|
||||
|
||||
// 检查是否在有效状态下操作
|
||||
if (this.IsDisposed || this.Disposing || pictureBoxTemperatureDisplay == null || pictureBoxTemperatureDisplay.IsDisposed)
|
||||
if (this.IsDisposed || this.Disposing)
|
||||
{
|
||||
// 如果窗口已关闭或正在关闭,释放传入的图像
|
||||
value?.Dispose();
|
||||
@@ -146,11 +144,9 @@ namespace JoyD.Windows.CS
|
||||
try { mRealTimeImage.Dispose(); } catch { }
|
||||
}
|
||||
|
||||
// 设置新图像
|
||||
// 只设置mRealTimeImage,不直接更新UI
|
||||
// UI更新将由定时器的Timer_Tick事件处理
|
||||
mRealTimeImage = value;
|
||||
|
||||
// 立即更新UI
|
||||
UpdatePictureBoxImage();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user