Aspose.PSD for .NET 19.4 - 发布说明

关键 摘要 类别
PSDNET-87 使功能可以将 JPEG/PNG 等图像文件加载到 PsdImage 中,而非直接加载(Aspose.PSD 不支持直接加载) 功能
PSDNET-120 支持每个颜色通道16位的RGB颜色模式(每个颜色64位) 功能
PSDNET-108 支持图层矢量蒙版和文本图层自定义翻转旋转 功能
PSDNET-99 所有亚洲字符无法正确显示 错误
PSDNET-116 \r\n 符号被解释为错误的双行间隔 错误
PSDNET-117 如果使用包含换行符的字符串更新 TextLayer,则 PSD 文件将无法读取 错误
PSDNET-118 如果使用包含制表符符号的字符串更新 TextLayer,则处理过程会失败并显示异常 错误

公共 API 更改

添加的 API:

  • M:Aspose.PSD.FileFormats.Psd.PsdImage.AddLayer(Aspose.PSD.FileFormats.Psd.Layers.Layer)
  • M:Aspose.PSD.FileFormats.Psd.Layers.Layer.#ctor(Aspose.PSD.RasterImage)

已删除的 API:

  • T:Aspose.PSD.FileFormats.Gif.GifImage
  • M:Aspose.PSD.FileFormats.Gif.GifImage.#ctor(Aspose.PSD.FileFormats.Gif.Blocks.GifFrameBlock,Aspose.PSD.IColorPalette)
  • M:Aspose.PSD.FileFormats.Gif.GifImage.#ctor(Aspose.PSD.FileFormats.Gif.Blocks.GifFrameBlock)
  • M:Aspose.PSD.FileFormats.Gif.GifImage.#ctor(Aspose.PSD.FileFormats.Gif.Blocks.GifFrameBlock,Aspose.PSD.IColorPalette,System.Boolean,System.Byte,System.Byte,System.Byte,System.Boolean)
  • P:Aspose.PSD.FileFormats.Gif.GifImage.FileFormat
  • P:Aspose.PSD.FileFormats.Gif.GifImage.XmpData
  • P:Aspose.PSD.FileFormats.Gif.GifImage.HasTrailer
  • P:Aspose.PSD.FileFormats.Gif.GifImage.IsPaletteSorted
  • P:Aspose.PSD.FileFormats.Gif.GifImage.PaletteColorResolutionBits
  • P:Aspose.PSD.FileFormats.Gif.GifImage.Width
  • P:Aspose.PSD.FileFormats.Gif.GifImage.Height
  • P:Aspose.PSD.FileFormats.Gif.GifImage.BitsPerPixel
  • P:Aspose.PSD.FileFormats.Gif.GifImage.Blocks
  • P:Aspose.PSD.FileFormats.Gif.GifImage.ActiveFrame
  • P:Aspose.PSD.FileFormats.Gif.GifImage.BackgroundColor
  • P:Aspose.PSD.FileFormats.Gif.GifImage.BackgroundColorIndex
  • P:Aspose.PSD.FileFormats.Gif.GifImage.PixelAspectRatio
  • P:Aspose.PSD.FileFormats.Gif.GifImage.IsCached
  • P:Aspose.PSD.FileFormats.Gif.GifImage.HasTransparentColor
  • P:Aspose.PSD.FileFormats.Gif.GifImage.TransparentColor
  • P:Aspose.PSD.FileFormats.Gif.GifImage.HasBackgroundColor
  • P:Aspose.PSD.FileFormats.Gif.GifImage.ImageOpacity
  • M:Aspose.PSD.FileFormats.Gif.GifImage.Dither(Aspose.PSD.DitheringMethod,System.Int32,Aspose.PSD.IColorPalette)
  • M:Aspose.PSD.FileFormats.Gif.GifImage.CacheData
  • M:Aspose.PSD.FileFormats.Gif.GifImage.RotateFlipAll(Aspose.PSD.RotateFlipType)
  • M:Aspose.PSD.FileFormats.Gif.GifImage.OrderBlocks
  • M:Aspose.PSD.FileFormats.Gif.GifImage.ClearBlocks
  • M:Aspose.PSD.FileFormats.Gif.GifImage.InsertBlock(System.Int32,Aspose.PSD.FileFormats.Gif.IGifBlock)
  • M:Aspose.PSD.FileFormats.Gif.GifImage.AddBlock(Aspose.PSD.FileFormats.Gif.IGifBlock)
  • M:Aspose.PSD.FileFormats.Gif.GifImage.RemoveBlock(Aspose.PSD.FileFormats.Gif.IGifBlock)
  • M:Aspose.PSD.FileFormats.Gif.GifImage.RotateFlip(Aspose.PSD.RotateFlipType)
  • M:Aspose.PSD.FileFormats.Gif.GifImage.Rotate(System.Single,System.Boolean,Aspose.PSD.Color)
  • M:Aspose.PSD.FileFormats.Gif.GifImage.Resize(System.Int32,System.Int32,Aspose.PSD.ResizeType)
  • M:Aspose.PSD.FileFormats.Gif.GifImage.Resize(System.Int32,System.Int32,Aspose.PSD.ImageResizeSettings)
  • M:Aspose.PSD.FileFormats.Gif.GifImage.ResizeProportional(System.Int32,System.Int32,Aspose.PSD.ResizeType)
  • M:Aspose.PSD.FileFormats.Gif.GifImage.Crop(Aspose.PSD.Rectangle)
  • M:Aspose.PSD.FileFormats.Gif.GifImage.Grayscale
  • M:Aspose.PSD.FileFormats.Gif.GifImage.BinarizeFixed(System.Byte)
  • M:Aspose.PSD.FileFormats.Gif.GifImage.BinarizeOtsu
  • M:Aspose.PSD.FileFormats.Gif.GifImage.BinarizeBradley(System.Double)
  • M:Aspose.PSD.FileFormats.Gif.GifImage.AdjustBrightness(System.Int32)
  • M:Aspose.PSD.FileFormats.Gif.GifImage.AdjustContrast(System.Single)
  • M:Aspose.PSD.FileFormats.Gif.GifImage.AdjustGamma(System.Single,System.Single,System.Single)
  • M:Aspose.PSD.FileFormats.Gif.GifImage.AdjustGamma(System.Single)
  • M:Aspose.PSD.FileFormats.Gif.GifImage.Filter(Aspose.PSD.Rectangle,Aspose.PSD.ImageFilters.FilterOptions.FilterOptionsBase)
  • M:Aspose.PSD.FileFormats.Gif.GifImage.ReplaceColor(System.Int32,System.Byte,System.Int32)
  • M:Aspose.PSD.FileFormats.Gif.GifImage.ReplaceNonTransparentColors(System.Int32)
  • T:Aspose.PSD.FileFormats.Tiff.TiffImage
  • M:Aspose.PSD.FileFormats.Tiff.TiffImage.#ctor(Aspose.PSD.FileFormats.Tiff.TiffFrame)
  • M:Aspose.PSD.FileFormats.Tiff.TiffImage.#ctor(Aspose.PSD.FileFormats.Tiff.TiffFrame[])
  • M:Aspose.PSD.FileFormats.Tiff.TiffImage.BinarizeBradley(System.Double,System.Int32)
  • P:Aspose.PSD.FileFormats.Tiff.TiffImage.HasAlpha
  • P:Aspose.PSD.FileFormats.Tiff.TiffImage.HasTransparentColor
  • P:Aspose.PSD.FileFormats.Tiff.TiffImage.FileFormat
  • P:Aspose.PSD.FileFormats.Tiff.TiffImage.PremultiplyComponents
  • P:Aspose.PSD.FileFormats.Tiff.TiffImage.ByteOrder
  • P:Aspose.PSD.FileFormats.Tiff.TiffImage.HorizontalResolution
  • P:Aspose.PSD.FileFormats.Tiff.TiffImage.VerticalResolution
  • P:Aspose.PSD.FileFormats.Tiff.TiffImage.BackgroundColor
  • P:Aspose.PSD.FileFormats.Tiff.TiffImage.BitsPerPixel
  • P:Aspose.PSD.FileFormats.Tiff.TiffImage.ActiveFrame
  • P:Aspose.PSD.FileFormats.Tiff.TiffImage.Frames
  • P:Aspose.PSD.FileFormats.Tiff.TiffImage.Height
  • P:Aspose.PSD.FileFormats.Tiff.TiffImage.Width
  • P:Aspose.PSD.FileFormats.Tiff.TiffImage.IsCached
  • P:Aspose.PSD.FileFormats.Tiff.TiffImage.ExifData
  • P:Aspose.PSD.FileFormats.Tiff.TiffImage.ImageOpacity
  • P:Aspose.PSD.FileFormats.Tiff.TiffImage.XmpData
  • M:Aspose.PSD.FileFormats.Tiff.TiffImage.AlignResolutions
  • M:Aspose.PSD.FileFormats.Tiff.TiffImage.Dither(Aspose.PSD.DitheringMethod,System.Int32,Aspose.PSD.IColorPalette)
  • M:Aspose.PSD.FileFormats.Tiff.TiffImage.SetResolution(System.Double,System.Double)
  • M:Aspose.PSD.FileFormats.Tiff.TiffImage.CacheData
  • M:Aspose.PSD.FileFormats.Tiff.TiffImage.RotateFlip(Aspose.PSD.RotateFlipType)
  • M:Aspose.PSD.FileFormats.Tiff.TiffImage.RotateFlipAll(Aspose.PSD.RotateFlipType)
  • M:Aspose.PSD.FileFormats.Tiff.TiffImage.Rotate(System.Single,System.Boolean,Aspose.PSD.Color)
  • M:Aspose.PSD.FileFormats.Tiff.TiffImage.AddFrame(Aspose.PSD.FileFormats.Tiff.TiffFrame)
  • M:Aspose.PSD.FileFormats.Tiff.TiffImage.Add(Aspose.PSD.FileFormats.Tiff.TiffImage)
  • M:Aspose.PSD.FileFormats.Tiff.TiffImage.AddFrames(Aspose.PSD.FileFormats.Tiff.TiffFrame[])
  • M:Aspose.PSD.FileFormats.Tiff.TiffImage.InsertFrame(System.Int32,Aspose.PSD.FileFormats.Tiff.TiffFrame)
  • M:Aspose.PSD.FileFormats.Tiff.TiffImage.RemoveFrame(System.Int32)
  • M:Aspose.PSD.FileFormats.Tiff.TiffImage.RemoveFrame(Aspose.PSD.FileFormats.Tiff.TiffFrame)
  • M:Aspose.PSD.FileFormats.Tiff.TiffImage.Resize(System.Int32,System.Int32,Aspose.PSD.ResizeType)
  • M:Aspose.PSD.FileFormats.Tiff.TiffImage.Resize(System.Int32,System.Int32,Aspose.PSD.ImageResizeSettings)
  • M:Aspose.PSD.FileFormats.Tiff.TiffImage.ResizeWidthProportionally(System.Int32,Aspose.PSD.ResizeType)
  • M:Aspose.PSD.FileFormats.Tiff.TiffImage.ResizeHeightProportionally(System.Int32,Aspose.PSD.ResizeType)
  • M:Aspose.PSD.FileFormats.Tiff.TiffImage.ResizeProportional(System.Int32,System.Int32,Aspose.PSD.ResizeType)
  • M:Aspose.PSD.FileFormats.Tiff.TiffImage.Crop(Aspose.PSD.Rectangle)
  • M:Aspose.PSD.FileFormats.Tiff.TiffImage.Grayscale
  • M:Aspose.PSD.FileFormats.Tiff.TiffImage.BinarizeFixed(System.Byte)
  • M:Aspose.PSD.FileFormats.Tiff.TiffImage.BinarizeOtsu
  • M:Aspose.PSD.FileFormats.Tiff.TiffImage.BinarizeBradley(System.Double)
  • M:Aspose.PSD.FileFormats.Tiff.TiffImage.Crop(System.Int32,System.Int32,System.Int32,System.Int32)
  • M:Aspose.PSD.FileFormats.Tiff.TiffImage.AdjustBrightness(System.Int32)
  • M:Aspose.PSD.FileFormats.Tiff.TiffImage.AdjustContrast(System.Single)
  • M:Aspose.PSD.FileFormats.Tiff.TiffImage.AdjustGamma(System.Single,System.Single,System.Single)
  • M:Aspose.PSD.FileFormats.Tiff.TiffImage.AdjustGamma(System.Single)
  • M:Aspose.PSD.FileFormats.Tiff.TiffImage.Filter(Aspose.PSD.Rectangle,Aspose.PSD.ImageFilters.FilterOptions.FilterOptionsBase)
  • M:Aspose.PSD.FileFormats.Tiff.TiffImage.ReplaceColor(System.Int32,System.Byte,System.Int32)
  • M:Aspose.PSD.FileFormats.Tiff.TiffImage.ReplaceNonTransparentColors(System.Int32)
  • M:Aspose.PSD.FileFormats.Tiff.TiffImage.ReplaceFrame(System.Int32,Aspose.PSD.FileFormats.Tiff.TiffFrame)

用法示例:

PSDNET-87. 使功能可以将 JPEG/PNG 等图像文件加载到 PsdImage 中,而非直接加载(Aspose.PSD 不支持直接加载)

 string filePath = "PsdExample.psd";

string outputFilePath = "PsdResult.psd";

using(var image = new PsdImage(200, 200)) {

 using(var im = Image.Load(filePath)) {

  Layer layer = null;

  try {

   layer = new Layer((RasterImage) im);

   image.AddLayer(layer);

  } catch (Exception e) {

   if (layer != null) {

    layer.Dispose();

   }

   throw;

  }

 }

 image.Save(outputFilePath);

}  

PSDNET-120. 支持每个颜色通道16位的RGB颜色模式(每个颗色64位)

  // 支持每个颜色通道16位的RGB颜色模式(每个颗色64位)

string sourceFileName = "inRgb16.psd.psd";

string outputFilePathJpg = "outRgb16.jpg";

string outputFilePathPsd = "outRgb16.psd";

var options = new PsdLoadOptions();

using(PsdImage image = (PsdImage) Image.Load(sourceFileName, options)) {

 image.Save(outputFilePathPsd, new PsdOptions(image));

 image.Save(outputFilePathJpg, new JpegOptions() {

  Quality = 100

 });

}

// 文件必须可以在不出现异常的情况下打开,并且对 Photoshop 可读

using(Image image = Image.Load(outputFilePathPsd)) {}  

PSDNET-108. 支持图层矢量蒙版和文本图层自定义翻转旋转

 // 旋转翻转操作与 PSD 不符

var sourceFile = "1.psd";

var pngPath = "RotateFlipTest2617.png";

var psdPath = "RotateFlipTest2617.psd";

var flipType = RotateFlipType.Rotate270FlipXY;

using(var im = (PsdImage)(Image.Load(sourceFile))) {

 im.RotateFlip(flipType);

 im.Save(pngPath, new PngOptions() {

  ColorType = PngColorType.TruecolorWithAlpha

 });

 im.Save(psdPath);

}

PSDNET-99. 所有亚洲字符无法正确显示

请查看附带示例

PSDNET-116. \r\n 符号被解释为错误的双行间隔

 // \r\n 符号被解释为错误的双行间隔

string sourceFileName = "TextTest.psd";

string exportPath = "Result.psd";

using(Image image = Image.Load(sourceFileName)) {

 if (!(image is PsdImage)) {

  return;

 }

 PsdImage psdImage = (PsdImage) image;

 Layer[] layers = psdImage.Layers;

 for (int index = layers.Length - 1; index >= 0; index--) {

  Layer layer = layers[index];

  if (!(layer is TextLayer)) {

   continue;

  }

  TextLayer textLayer = (TextLayer) layer;

  textLayer.UpdateText("First Paragraph\r\nSecond Paragraph\rThird paragraph\nFourth Paragraph");

 }

 PsdOptions imageOptions = new PsdOptions(psdImage);

 psdImage.Save(exportPath, imageOptions);

}

// 文件必须可以在不出现异常的情况下打开,并且对 Photoshop 可读。必须包含3个换行符,每行之间有一个

using(Image image = Image.Load(exportPath)) {}

PSDNET-117. 如果使用包含换行符的字符串更新 TextLayer,则 PSD 文件将无法读取

 // 如果使用包含换行符的字符串更新 TextLayer,则 PSD 文件将无法读取

string sourceFileName = "TextTest.psd";

string exportPath = "Result.psd";

using(Image image = Image.Load(sourceFileName)) {

 if (!(image is PsdImage)) {

  return;

 }

 PsdImage psdImage = (PsdImage) image;

 Layer[] layers = psdImage.Layers;

 for (int index = layers.Length - 1; index >= 0; index--) {

  Layer layer = layers[index];

  if (!(layer is TextLayer)) {

   continue;

  }

  TextLayer textLayer = (TextLayer) layer;

  textLayer.UpdateText("First Paragraph\r\nSecond Paragraph\r\nThird paragraph\r\nFourth Paragraph");

 }

 PsdOptions imageOptions = new PsdOptions(psdImage);

 psdImage.Save(exportPath, imageOptions);

}

// 文件必须可以在不出现异常的情况下打开,并且对 Photoshop 可读

using(Image image = Image.Load(exportPath)) {}

PSDNET-118. 如果使用包含制表符符号的字符串更新 TextLayer,则处理过程会失败并显示异常

 // 如果使用包含制表符符号的字符串更新 TextLayer,则处理过程会失败并显示异常

string sourceFileName = "TextTest.psd";

string exportPath = "Result.psd";

using(Image image = Image.Load(sourceFileName)) {

 if (!(image is PsdImage)) {

  return;

 }

 PsdImage psdImage = (PsdImage) image;

 Layer[] layers = psdImage.Layers;

 for (int index = layers.Length - 1; index >= 0; index--) {

  Layer layer = layers[index];

  if (!(layer is TextLayer)) {

   continue;

  }

  TextLayer textLayer = (TextLayer) layer;

  textLayer.UpdateText("Starting Text\tText After Tab");

 }

 PsdOptions imageOptions = new PsdOptions(psdImage);

 psdImage.Save(exportPath, imageOptions);

}

// 文件必须可以在不出现异常的情况下打开并且