C# LEADTOOLS解压缩示例获取异常
下面是Leadtools页面中的下一个示例 版本是19 但是我在visual studio中遇到了这个错误,{功能不受支持},我不知道我做错了什么C# LEADTOOLS解压缩示例获取异常,c#,leadtools-sdk,C#,Leadtools Sdk,下面是Leadtools页面中的下一个示例 版本是19 但是我在visual studio中遇到了这个错误,{功能不受支持},我不知道我做错了什么 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.IO; using Leadtools; using Leadtools.Codecs;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using Leadtools;
using Leadtools.Codecs;
namespace DicomTest3
{
public class Program
{
public static void Main(string[] args)
{
const string LEAD_VARS = @"C:\Users\Public\Documents\LEADTOOLSImages";
RasterSupport.SetLicense(
@"C:\LEADTOOLS 19\Common\License\LEADTOOLS.LIC",
File.ReadAllText(@"C:\LEADTOOLS 19\Common\License\LEADTOOLS.LIC.KEY")
);
RasterCodecs codecs = new RasterCodecs();
string srcFileName = Path.Combine(LEAD_VARS, "IMAGE1.CMP");
RasterImage image = codecs.Load(srcFileName);
// save with maximum quality
codecs.Options.Png.Save.QualityFactor = 1;
codecs.Save(image, Path.Combine(LEAD_VARS, "quality.png"), RasterImageFormat.Png, image.BitsPerPixel);
// save with maximum compression
codecs.Options.Png.Save.QualityFactor = 9;
codecs.Save(image, Path.Combine(LEAD_VARS, "compression.png"), RasterImageFormat.Png, image.BitsPerPixel);
// Clean up
image.Dispose();
codecs.Dispose();
}
}
}
此错误最可能的原因是无法加载PNG文件格式的程序集(编解码器DLL),即Leadtools.Codecs.PNG.DLL 您可以将其添加为.NET项目中的引用,也可以将其复制到包含EXE和其他LEADTOOLS程序集(如LEADTOOLS.Codecs.dll)的同一文件夹中 我们的演示避免了此类问题,因为它们都构建在项目平台的BIN子文件夹中。例如,如果您构建了一个32位的.NET 4演示,其EXE将被放置在此文件夹中:
LEADTOOLS 19\Bin\Dotnet4\Win32 此文件夹包含Win32的所有LEADTOOLS Dotnet4程序集,包括编解码器 帮助主题详细说明了不同工具包功能需要哪些程序集 如果这不能为您解决问题,请在此处提供更多详细信息,或通过电子邮件发送LEADTOOLS支持来打开支持案例