回転テキストレイヤーのレンダリング
回転テキストレイヤーのレンダリング
Aspose.PSD は、回転したテキストレイヤーをレンダリングする機能を提供します。以下の例では、既存の PSD ファイルを Image クラスの static Load メソッドにファイルパスを渡してロードします。続けて、PsdImage インスタンスの Save メソッドを呼び出します。
以下のコードスニペットでは、回転したText layerをレンダリングする方法を示しています。
// 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 クラスによって公開された factory メソッド 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); | |
} |