原創|產品更新|編輯:李顯亮|2021-03-30 09:36:32.390|閱讀 320 次
概述:Aspose.PSD for .Net更新至新版本v21.3,添加SectionDividerLayer以改善圖層組的體驗,歡迎下載體驗。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
Aspose.PSD是高級PSD和入門級AI文件格式操作API,允許創建和編輯Photoshop文件,并提供更新圖層屬性,添加水印,執行圖形操作或將一種文件格式轉換為另一種文件的功能,沒有任何Adobe Photoshop或Adobe Illustrator依賴項。
Aspose.PSD for .Net更新至新版本v21.3,添加SectionDividerLayer以改善圖層組的體驗,修復筆畫效果屬性未保存到PSD文件等問題。
>>你可以點擊這里下載Aspose.PSD for .NET v21.3試體驗。
key | 概述 | 類別 |
---|---|---|
PSDNET-823 | 添加SectionDividerLayer以改善圖層組的體驗 | 增強功能 |
PSDNET-694 | 讀取PattResource時,寬度和高度已交換 | Bug修復 |
PSDNET-789 | 不正確的混合超過一層效果 | Bug修復 |
PSDNET-805 | 層效應不止一個時的混合順序和邏輯不正確 | Bug修復 |
PSDNET-842 | 筆畫效果屬性未保存到PSD文件 | Bug修復 |
PSDNET-823——添加SectionDividerLayer以改善圖層組的體驗
// The following code demonstrates SectionDividerLayer layers and how to get the related to it LayerGroup. // Layers hierarchy // [0]: '' SectionDividerLayer for Group 1 // [1]: 'Layer 1' Regular Layer // [2]: '' SectionDividerLayer for Group 2 // [3]: '' SectionDividerLayer for Group 3 // [4]: 'Group 3' GroupLayer // [5]: 'Group 2' GroupLayer // [6]: 'Group 1' GroupLayer void AssertAreEqual(object expected, object actual, string message = null) { if (!object.Equals(expected, actual)) { throw new FormatException(message ?? "Objects are not equal."); } } using (var image = new PsdImage(100, 100)) { // Creating layers hierarchy // Add the LayerGroup 'Group 1' LayerGroup group1 = image.AddLayerGroup("Group 1", 0, true); // Add regular layer Layer layer1 = new Layer(); layer1.DisplayName = "Layer 1"; group1.AddLayer(layer1); // Add the LayerGroup 'Group 2' LayerGroup group2 = group1.AddLayerGroup("Group 2", 1); // Add the LayerGroup 'Group 3' LayerGroup group3 = group2.AddLayerGroup("Group 3", 0); // Gets the SectionDividerLayer's SectionDividerLayer divider1 = (SectionDividerLayer)image.Layers[0]; SectionDividerLayer divider2 = (SectionDividerLayer)image.Layers[2]; SectionDividerLayer divider3 = (SectionDividerLayer)image.Layers[3]; // using the SectionDividerLayer.GetRelatedLayerGroup() method, obtains the related LayerGroup instance. AssertAreEqual(group1.DisplayName, divider1.GetRelatedLayerGroup().DisplayName); // the same LayerGroup AssertAreEqual(group2.DisplayName, divider2.GetRelatedLayerGroup().DisplayName); // the same LayerGroup AssertAreEqual(group3.DisplayName, divider3.GetRelatedLayerGroup().DisplayName); // the same LayerGroup LayerGroup folder1 = divider1.GetRelatedLayerGroup(); AssertAreEqual(5, folder1.Layers.Length); // 'Group 1' contains 5 layers }
PSDNET-694——讀取PattResource時,寬度和高度已交換
string sourceFile = "Untitled-1.psd"; string outputFile = "output.png"; using (var image = (PsdImage)Image.Load(sourceFile)) { var fillLayer = (FillLayer)image.Layers[1]; fillLayer.Update(); // invoke pattern rendering image.Save(outputFile, new PngOptions()); }
PSDNET-842——修復筆畫效果屬性未保存到PSD文件
void AssertAreEqual(object expected, object actual, string message = null) { if (!object.Equals(expected, actual)) { throw new FormatException(message ?? "Objects are not equal."); } } string srcFile = "badStrokeEffect.psd"; string output = "output.psd"; using (var image = (PsdImage)Image.Load(srcFile, new PsdLoadOptions() { LoadEffectsResource = true })) { var layer1 = new Layer(); image.AddLayer(layer1); layer1.BlendingOptions.AddStroke(FillType.Color); // Will not throw ArgumentNullException StrokeEffect strokeEffect = image.Layers[1].BlendingOptions.AddStroke(FillType.Color); strokeEffect.Size = 10; strokeEffect.Position = StrokePosition.Outside; strokeEffect.Overprint = true; image.Save(output); } // Checks saved values using (var image = (PsdImage)Image.Load(output, new PsdLoadOptions() { LoadEffectsResource = true })) { StrokeEffect strokeEffect = (StrokeEffect)image.Layers[1].BlendingOptions.Effects[0]; AssertAreEqual(10, strokeEffect.Size); AssertAreEqual(StrokePosition.Outside, strokeEffect.Position); AssertAreEqual(true, strokeEffect.Overprint); }
如果你想試用Aspose的全部完整功能,可聯系在線客服獲取30天臨時授權體驗。
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn