PSD文档处理工具Aspose.PSD最新功能更新,示例解析教你快速学会将图层转换为智能对象层

Aspose.PSD for .Net更新至新版本v20.12,支持将图层转换为智能对象层,尝试使用SmartObjectLayers打开PSB文件时的未知资源标头,修复图像渲染不正确等问题,欢迎下载体验。

Aspose.PSD是高级PSD和入门级AI文件格式操作API,允许创建和编辑Photoshop文件,并提供更新图层属性,添加水印,执行图形操作或将一种文件格式转换为另一种文件的功能,没有任何Adobe Photoshop或Adobe Illustrator依赖项。

Aspose.PSD for .Net更新至新版本v20.12,支持将图层转换为智能对象层,尝试使用SmartObjectLayers打开PSB文件时的未知资源标头,修复图像渲染不正确等问题。

>>你可以点击这里下载Aspose.PSD for .NET v20.12测试体验。

整合所有格式API处理控件Aspose.Total永久授权火热促销中,联系客服立马1分钟了解全部!

具体更新内容

key 概述 类别
PSDNET-757 支持将图层转换为智能对象层 新功能
PSDNET-764 如果我们尝试添加PSB文件,则SmartObjectLayer.ReplaceContents方法将引发NullReferenceException Bug修复
PSDNET-773 如果图层大于Canvas,则CMYK 8位和CMYK 16位图像的渲染不正确 Bug修复
PSDNET-782 可以使用我们的API打开保存的PSB文件,但不能使用Photoshop打开 Bug修复
PSDNET-783 如果我们尝试在具有共享数据源的特定PSD中更改智能层,则会出现异常 Bug修复
PSDNET-765 PsdImageException:尝试使用SmartObjectLayers打开PSB文件时的未知资源标头 增强功能

新功能解析

PSDNET-757——支持将图层转换为智能对象层

     string dataDir = "PSDNET757_1\";            string outputDir = dataDir + "output\";            // These examples demonstrate how to convert layers to a smart object layer in the PSD file            ExampleOfConvertingToSmartObjectLayer("ThreeRegularLayers", 0, 1);            ExampleOfConvertingToSmartObjectLayer("FourWithMasks", 0, 2);            ExampleOfConvertingToSmartObjectLayer("dummy", 2, 3, 1);            ExampleOfConvertingToSmartObjectLayer("dummy_group", 6, 2);            ExampleOfConvertingToSmartObjectLayer("argb16bit_5x5", 0);            ExampleOfConvertingToSmartObjectLayer("cmyk16bit_5x5", 0);            ExampleOfConvertingToSmartObjectLayer("grayscale5x5", 0);            void ExampleOfConvertingToSmartObjectLayer(string filePath, params int[] layerNumbers)            {                string outputFilePath = outputDir + "Converted_" + filePath + ".psd";                string pngOutputPath = Path.ChangeExtension(outputFilePath, ".png");                using (PsdImage image = (PsdImage)Image.Load(dataDir + filePath + ".psd"))                {                    var layerCount = image.Layers.Length;                    var smartObjectLayer = image.SmartObjectProvider.ConvertToSmartObject(layerNumbers);                    var newLayerCount = image.Layers.Length;                    image.Save(pngOutputPath, new PngOptions() { ColorType = PngColorType.TruecolorWithAlpha });                    image.Save(outputFilePath, new PsdOptions(image));                }            }

PSDNET-765——PsdImageException:尝试使用SmartObjectLayers打开PSB文件时的未知资源标头

  // This example demonstrates that the specified PSD file is loaded, saved, and loaded again correctly.            // Test manually that the saved files can be opened by AdobePhotoshop           string baseFolder = "PSDNET765_1\";            string outputFolder = baseFolder + "output\";            string fileName = "CommonPsb.psb";            string filePath = baseFolder + fileName;            string psbOutputPath = outputFolder + fileName + "_saved.psb";            string psdOutputPath = outputFolder + fileName + "_saved_as_psd.psd";            using (PsdImage image = (PsdImage)Image.Load(filePath))            {                image.Save(psbOutputPath, new PsdOptions(image) { FileFormatVersion = FileFormatVersion.Psb, Resources = null, XmpData = null });                image.Save(psdOutputPath, new PsdOptions(image) { FileFormatVersion = FileFormatVersion.Psd, Resources = null, XmpData = null });            }            using (PsdImage image1 = (PsdImage)Image.Load(psdOutputPath))            {                Console.WriteLine("PSD loaded");            }            using (PsdImage image2 = (PsdImage)Image.Load(psbOutputPath))            {                Console.WriteLine("PSB loaded");            }


还想要更多吗可以点击阅读【2020 · Aspose最新资源整合】查找需要的教程资源。如果您有任何疑问或需求,请随时加入Aspose技术交流群(),我们很高兴为您提供查询和咨询
标签:

来源:慧都

声明:本站部分文章及图片转载于互联网,内容版权归原作者所有,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!

上一篇 2021年1月2日
下一篇 2021年1月2日

相关推荐

发表回复

登录后才能评论