From 32e832a898a6466369669717e7b11f7c957371bb Mon Sep 17 00:00:00 2001
From: C3204 <zhengyabo@lanpucloud.cn>
Date: 星期四, 25 十二月 2025 09:49:17 +0800
Subject: [PATCH] 修复log显示以及文件大小问题。

---
 LB_VisionProcesses/Cameras/CameraConfig.cs |   25 +++++++++++++++++++++----
 1 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/LB_VisionProcesses/Cameras/CameraConfig.cs b/LB_VisionProcesses/Cameras/CameraConfig.cs
index 66303bd..86ebc86 100644
--- a/LB_VisionProcesses/Cameras/CameraConfig.cs
+++ b/LB_VisionProcesses/Cameras/CameraConfig.cs
@@ -256,12 +256,17 @@
                     {
                         times--;
                         if (TriggerSource == TriggerSource.Software)
+                        {
                             Camera.GetImageWithSoftTrigger(out bitmap, timeout);
+                        }
                         else
+                        {
                             Camera.GetImage(out bitmap, timeout);
-
+                        }
                         if (bitmap != null)
+                        {
                             break;
+                        }
                         else if (isRegrab)
                         {
                             Debug.WriteLine($"鍙栧浘澶辫触,閲嶆柊鍙栧浘,鍓╀綑娆℃暟:{times}");
@@ -269,8 +274,9 @@
                     } while (times > 0 && isRegrab);
 
                     if (isUpParams)
+                    {
                         Camera.SetCamConfig(oriConfig);
-
+                    }
                     OutputImage = bitmap;
                 }
 
@@ -293,14 +299,23 @@
         {
             Result = true;
             Msg = "";
-            OutputImage = null;
-
+            if (OutputImage != null)
+            {
+                if (OutputImage is Bitmap)
+                {
+                    ((Bitmap)OutputImage).Dispose();
+                }
+                OutputImage = null;
+            }
             if (Record != null)
+            {
                 Record.Dispose();
+            }
         }
 
         public override void Dispose()
         {
+
             return;
         }
 
@@ -314,7 +329,9 @@
                 if (OutputImage != null)
                 {
                     if (OutputImage is Bitmap)
+                    {
                         obj.OutputImage = ((Bitmap)OutputImage).Clone();
+                    }
                 }
 
                 return obj;

--
Gitblit v1.9.3