旋转文本图层的渲染

旋转文本图层的渲染

Aspose.PSD提供了旋转文本图层的渲染功能。在下面的示例中,通过将文件路径传递给Image类的静态Load方法来加载现有PSD文件。现在调用PsdImage实例的Save方法。

以下代码片段向您展示了如何渲染旋转的文本图层

// For complete examples and data files, please go to https://github.com/aspose-psd/Aspose.PSD-for-.NET
string exportPath = dataDir + "TransformedTextExport.psd";
string exportPathPng = dataDir + "TransformedTextExport.png";
var im = (PsdImage)Image.Load(sourceFileName);
using (im)
{
im.Save(exportPath);
im.Save(exportPathPng, new PngOptions()
{
ColorType = PngColorType.Grayscale
});
}

旋转矢量蒙版和文本图层

Aspose.PSD提供了旋转矢量蒙版和文本图层的功能。Aspose.PSD已经公开了RotateFlip方法以旋转矢量蒙版和文本图层。旋转图层的步骤如下简单:

  • 使用Image类公开的工厂方法Load将PSD文件加载为图像。
  • 设置所需的RotateFlipType
  • 调用RotateFlip方法。
  • 保存结果。

以下代码片段向您展示了如何旋转矢量蒙版和文本图层。

// For complete examples and data files, please go to https://github.com/aspose-psd/Aspose.PSD-for-.NET
var pngPath = dataDir + "RotateFlipTest2617.png";
var psdPath = dataDir + "RotateFlipTest2617.psd";
var flipType = RotateFlipType.Rotate270FlipXY;
using (var im = (PsdImage)(Image.Load(sourceFile)))
{
im.RotateFlip(flipType);
im.Save(pngPath, new PngOptions()
{
ColorType = PngColorType.TruecolorWithAlpha
});
im.Save(psdPath);
}