From 499a261e08f452aa81c4b5a4bad81550ec2e179d Mon Sep 17 00:00:00 2001
From: C3204 <zhengyabo@lanpucloud.cn>
Date: 星期三, 31 十二月 2025 14:03:07 +0800
Subject: [PATCH] 优化相机运动控制界面设计显示1
---
LB_VisionProcesses/Cameras/CameraConfig.cs | 36 ++++++++++++++++++++++++++++++++----
1 files changed, 32 insertions(+), 4 deletions(-)
diff --git a/LB_VisionProcesses/Cameras/CameraConfig.cs b/LB_VisionProcesses/Cameras/CameraConfig.cs
index 8210a2e..4bec6f7 100644
--- a/LB_VisionProcesses/Cameras/CameraConfig.cs
+++ b/LB_VisionProcesses/Cameras/CameraConfig.cs
@@ -1,7 +1,9 @@
-锘縰sing Newtonsoft.Json;
+锘縰sing HalconDotNet;
+using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using OpenCvSharp;
using OpenCvSharp.Extensions;
+using System;
using System.Collections.Concurrent;
using System.Diagnostics;
using System.Text;
@@ -302,21 +304,47 @@
Msg = "";
if (OutputImage != null)
{
- if (OutputImage is Bitmap)
- {
+ if (OutputImage is HObject)
+ ((HObject)OutputImage).Dispose();
+ else if (OutputImage is Mat)
+ ((Mat)OutputImage).Dispose();
+ else if (OutputImage is Bitmap)
((Bitmap)OutputImage).Dispose();
- }
+
OutputImage = null;
}
if (Record != null)
{
Record.Dispose();
+ Record = null;
}
}
public override void Dispose()
{
+ if (InputImage != null)
+ {
+ if (InputImage is HObject)
+ ((HObject)InputImage).Dispose();
+ else if (InputImage is Mat)
+ ((Mat)InputImage).Dispose();
+ else if (InputImage is Bitmap)
+ ((Bitmap)InputImage).Dispose();
+ InputImage = null;
+ }
+
+ if (OutputImage != null)
+ {
+ if (OutputImage is HObject)
+ ((HObject)OutputImage).Dispose();
+ else if (OutputImage is Mat)
+ ((Mat)OutputImage).Dispose();
+ else if (OutputImage is Bitmap)
+ ((Bitmap)OutputImage).Dispose();
+
+ OutputImage = null;
+ }
return;
}
--
Gitblit v1.9.3