原創|產品更新|編輯:李顯亮|2021-01-04 09:37:36.713|閱讀 794 次
概述:Aspose.PSD for .Net更新至新版本v20.12,支持將圖層轉換為智能對象層,嘗試使用SmartObjectLayers打開PSB文件時的未知資源標頭,修復圖像渲染不正確等問題,歡迎下載體驗。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
Aspose.PSD是高級PSD和入門級AI文件格式操作API,允許創建和編輯Photoshop文件,并提供更新圖層屬性,添加水印,執行圖形操作或將一種文件格式轉換為另一種文件的功能,沒有任何Adobe Photoshop或Adobe Illustrator依賴項。
Aspose.PSD for .Net更新至新版本v20.12,支持將圖層轉換為智能對象層,嘗試使用SmartObjectLayers打開PSB文件時的未知資源標頭,修復圖像渲染不正確等問題。
>>你可以點擊這里下載Aspose.PSD for .NET v20.12測試體驗。
| 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 Adobe® Photoshop®
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");
}
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@ke049m.cn