diff --git a/DH.Commons/Base/VisionEngineBase.cs b/DH.Commons/Base/VisionEngineBase.cs index dc1a769..f713dfb 100644 --- a/DH.Commons/Base/VisionEngineBase.cs +++ b/DH.Commons/Base/VisionEngineBase.cs @@ -3,6 +3,7 @@ using System.ComponentModel; using System.Drawing; using System.Drawing.Imaging; using DH.Commons.Enums; +using DH.Commons.Helper; using HalconDotNet; using OpenCvSharp; @@ -58,7 +59,8 @@ namespace DH.Commons.Base ImageSaveSet imageSaveSet = new ImageSaveSet() { FullName = fullname, - SaveImage = saveMap, + SaveImage = saveMap.CopyBitmap(), + ImageFormat = imageFormat.DeepSerializeClone() }; diff --git a/DH.Commons/DH.Commons.csproj b/DH.Commons/DH.Commons.csproj index 41a3dcc..1664e90 100644 --- a/DH.Commons/DH.Commons.csproj +++ b/DH.Commons/DH.Commons.csproj @@ -15,6 +15,7 @@ + diff --git a/DH.Commons/Helper/StaticHelper.cs b/DH.Commons/Helper/StaticHelper.cs index e80421b..3a75811 100644 --- a/DH.Commons/Helper/StaticHelper.cs +++ b/DH.Commons/Helper/StaticHelper.cs @@ -1,5 +1,5 @@ using Microsoft.CSharp.RuntimeBinder; - +using Newtonsoft.Json; using System.Collections.ObjectModel; using System.Drawing.Imaging; using System.Dynamic; @@ -34,7 +34,10 @@ namespace DH.Commons.Helper return result; } - + public static T DeepSerializeClone(this T t) + { + return JsonConvert.DeserializeObject(JsonConvert.SerializeObject(t)); + } /// /// 字节数组转换为整数 /// diff --git a/DH.Devices.Vision/DH.Devices.Vision.csproj b/DH.Devices.Vision/DH.Devices.Vision.csproj index a1dfe88..cbe8a69 100644 --- a/DH.Devices.Vision/DH.Devices.Vision.csproj +++ b/DH.Devices.Vision/DH.Devices.Vision.csproj @@ -11,6 +11,14 @@ AnyCPU;x64 + + False + + + + False + +