From fec341de45f4b3fd1825807f0b3261143fa13caa Mon Sep 17 00:00:00 2001
From: C3204 <zhengyabo@lanpucloud.cn>
Date: 星期一, 29 十二月 2025 17:03:45 +0800
Subject: [PATCH] 修复部分显示工具为面向对象。

---
 LB_VisionProcesses/Alogrithms/BaseAlgorithm/TAlgorithmEdit.cs |   23 ++++++++++++++++-------
 1 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/LB_VisionProcesses/Alogrithms/BaseAlgorithm/TAlgorithmEdit.cs b/LB_VisionProcesses/Alogrithms/BaseAlgorithm/TAlgorithmEdit.cs
index b3701a6..6ded39b 100644
--- a/LB_VisionProcesses/Alogrithms/BaseAlgorithm/TAlgorithmEdit.cs
+++ b/LB_VisionProcesses/Alogrithms/BaseAlgorithm/TAlgorithmEdit.cs
@@ -53,27 +53,36 @@
             get
             {
                 if (Subject == null)
+                {
                     return null;
+                }
                 return Subject.InputImage;
             }
             set
             {
                 Subject.InputImage = value;
-
                 if (InputImage == null)
+                {
                     return;
+                }
 
-                if (InputImage is HObject)
-                    inputImageHSmartWindowControl.ShowHoImage((HObject)value);
+                if (InputImage is HImage)
+                {
+                    inputImageHSmartWindowControl.ShowHoImage((HImage)value);
+                }
                 else if (InputImage is Bitmap)
                 {
-                    TAlgorithm.Bitmap2HObject((Bitmap)value, out HObject image);
-                    inputImageHSmartWindowControl.ShowHoImage(image);
+                    using (HImage image = TAlgorithm.Bitmap2HImage((Bitmap)value))
+                    {
+                        inputImageHSmartWindowControl.ShowHoImage(image);
+                    }
                 }
                 else if (InputImage is Mat)
                 {
-                    TAlgorithm.Mat2HObject((Mat)value, out HObject image);
-                    inputImageHSmartWindowControl.ShowHoImage(image);
+                    using (HImage image = TAlgorithm.Mat2HImage((Mat)value))
+                    {
+                        inputImageHSmartWindowControl.ShowHoImage(image);
+                    }
                 }
             }
         }

--
Gitblit v1.9.3