村结果图有问题

This commit is contained in:
TD 2025-04-02 19:13:18 +08:00
parent d63a6c42b3
commit 67ba78f268
4 changed files with 17 additions and 3 deletions

View File

@ -3,6 +3,7 @@ using System.ComponentModel;
using System.Drawing; using System.Drawing;
using System.Drawing.Imaging; using System.Drawing.Imaging;
using DH.Commons.Enums; using DH.Commons.Enums;
using DH.Commons.Helper;
using HalconDotNet; using HalconDotNet;
using OpenCvSharp; using OpenCvSharp;
@ -58,7 +59,8 @@ namespace DH.Commons.Base
ImageSaveSet imageSaveSet = new ImageSaveSet() ImageSaveSet imageSaveSet = new ImageSaveSet()
{ {
FullName = fullname, FullName = fullname,
SaveImage = saveMap, SaveImage = saveMap.CopyBitmap(),
ImageFormat = imageFormat.DeepSerializeClone()
}; };

View File

@ -15,6 +15,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="AntdUI" Version="1.8.9" /> <PackageReference Include="AntdUI" Version="1.8.9" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="OpenCvSharp4" Version="4.10.0.20241108" /> <PackageReference Include="OpenCvSharp4" Version="4.10.0.20241108" />
<PackageReference Include="OpenCvSharp4.Extensions" Version="4.10.0.20241108" /> <PackageReference Include="OpenCvSharp4.Extensions" Version="4.10.0.20241108" />
<PackageReference Include="OpenCvSharp4.runtime.win" Version="4.10.0.20241108" /> <PackageReference Include="OpenCvSharp4.runtime.win" Version="4.10.0.20241108" />

View File

@ -1,5 +1,5 @@
using Microsoft.CSharp.RuntimeBinder; using Microsoft.CSharp.RuntimeBinder;
using Newtonsoft.Json;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.Drawing.Imaging; using System.Drawing.Imaging;
using System.Dynamic; using System.Dynamic;
@ -34,7 +34,10 @@ namespace DH.Commons.Helper
return result; return result;
} }
public static T DeepSerializeClone<T>(this T t)
{
return JsonConvert.DeserializeObject<T>(JsonConvert.SerializeObject(t));
}
/// <summary> /// <summary>
/// 字节数组转换为整数 /// 字节数组转换为整数
/// </summary> /// </summary>

View File

@ -11,6 +11,14 @@
<Platforms>AnyCPU;x64</Platforms> <Platforms>AnyCPU;x64</Platforms>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<Optimize>False</Optimize>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Optimize>False</Optimize>
</PropertyGroup>