Unleash creative freedom for your C# and VB.NET applications using the latest release of Aspose.PSD for .NET (v24.8, DLLs). Utilize the new warp settings to perform text and smart object warping and integrate with your existing .NET projects effortlessly.
Leverage Text and Smart Object Warping Functionality
Obtain better control over the appearance of text and smart objects with the newly added WarpSettings
class in this version of the C# PSD manipulation API. It lets you apply different warp styles, set rotation, and adjust warp intensity for accurate 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*
Efficiently handle layers within content stream operators while managing AI files with 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*
AI Rendering Accuracy Improvements
In the newest update, the shortcomings between the rendering results of the .AI files in Aspose.PSD for .NET and Adobe Illustrator have been fixed to ascertain a more consistent user 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.