You can unlock a wider range of creative possibilities for your C# and VB.NET applications with the latest Aspose.PSD for .NET 24.8 (MSI) release. Easily perform text and smart object warping using this version of the API.
Refined Text and Smart Object Warping
Gain finer control over text and smart object appearance with the introduction of the new WarpSettings
class in this release of the C# PSD manipulation API. It allows you to apply various warp styles, define rotation, and adjust warp intensity for precise manipulation.
C# coding sample:
string sourceFile = Path.Combine(baseFolder, "smart_without_warp.psd");
var opt = new PsdLoadOptions()
{
LoadEffectsResource = true,
AllowWarpRepaint = true
};
string[] outputImageFile = new string[4];
string[] outputPsdFile = new string[4];
for (int caseIndex = 0; caseIndex < outputImageFile.Length; caseIndex++)
{
outputImageFile[caseIndex] = Path.Combine(outputFolder, "export_" + caseIndex + ".png");
outputPsdFile[caseIndex] = Path.Combine(outputFolder, "export_" + caseIndex + ".psd");
using (PsdImage img = (PsdImage)Image.Load(sourceFile, opt))
{
foreach (Layer layer in img.Layers)
{
if (layer is SmartObjectLayer)
{
var smartLayer = (SmartObjectLayer)layer;
smartLayer.WarpSettings = GetWarpSettingsByIndex(smartLayer.WarpSettings, caseIndex);
}
if (layer is TextLayer)
{
var textLayer = (TextLayer)layer;
if (caseIndex != 3)
{
textLayer.WarpSettings = GetWarpSettingsByIndex(textLayer.WarpSettings, caseIndex);
}
}
}
img.Save(outputPsdFile[caseIndex], new PsdOptions());
}
using (PsdImage img = (PsdImage)Image.Load(outputPsdFile[caseIndex], opt))
{
img.Save(outputImageFile[caseIndex],
new PngOptions() { CompressionLevel = 9, ColorType = PngColorType.TruecolorWithAlpha });
}
}
WarpSettings GetWarpSettingsByIndex(WarpSettings warpParams, int caseIndex)
{
switch (caseIndex)
{
case 0:
warpParams.Style = WarpStyles.Rise;
warpParams.Rotate = WarpRotates.Horizontal;
warpParams.Value = 20;
break;
case 1:
warpParams.Style = WarpStyles.Rise;
warpParams.Rotate = WarpRotates.Vertical;
warpParams.Value = 10;
break;
case 2:
warpParams.Style = WarpStyles.Flag;
warpParams.Rotate = WarpRotates.Horizontal;
warpParams.Value = 30;
break;
case 3:
warpParams.Style = WarpStyles.Custom;
warpParams.MeshPoints[2].Y += 70;
break;
}
return warpParams;
}
Source*
Effectively handles layer within content stream operators when working with AI files using Aspose.PSD for .NET API v24.8.
C# coding sample:
string sourceFile = Path.Combine(baseFolder, "Layers-NoPen.ai");
string outputFile = Path.Combine(outputFolder, "Layers-NoPen.output.png");
using (AiImage image = (AiImage)Image.Load(sourceFile))
{
image.Save(outputFile, new PngOptions());
}
//// Curves from layer named "Pen" should be hidden
Source*
Improved AI Rendering Accuracy
With the latest update, the discrepancies between the rendering of the .AI files in Aspose.PSD for .NET and Adobe Illustrator results have been addressed to ensure a more consistent experience.
C# coding sample:
string sourceFile = Path.Combine(baseFolder, "4.ai");
string outputFilePath = Path.Combine(outputFolder, "4.png");
using (AiImage image = (AiImage)Image.Load(sourceFile))
{
image.Save(outputFilePath, new PngOptions());
}
Source*
Bug Fixes
We have resolved an issue where the RelinkSmartObject
method does not apply to all smart objects in a PSD file.
You can view the list of all new features, enhancements, and bug fixes introduced in this release by visiting Aspose.PSD for .NET 24.8 Release Notes.