我正在关注 Leadtools 页面中的下一个示例 https://www.leadtools.com/help/leadtools/v19/dh/co/leadtools.codecs~leadtools.codecs.codecspngoptions.html
版本是19
但是我在visual studio中遇到了这个错误,{featured not supported},我不知道我做错了什么?
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();
}
}
}