PsdImage.Rotate
Contents
[
Hide
]Rotate(float)
Rotate image around the center.
public override void Rotate(float angle)
Parameter | Type | Description |
---|---|---|
angle | Single | The rotate angle in degrees. Positive values will rotate clockwise. |
Examples
The following code demonstrates ability to rotate the image by specific angle value.
[C#]
string sourceFileName = "TheHat.psd";
var pngOptions = new PngOptions() { ColorType = PngColorType.TruecolorWithAlpha };
// Whole image rotating
using (PsdImage image = (PsdImage)Image.Load(sourceFileName))
{
for (int i = 0; i < 4; i++)
{
int angle = i * 45;
image.Rotate(angle);
string outFileName = "TheHatRotated" + angle + ".png";
image.Save(outFileName, pngOptions);
}
}
// Layer rotating
using (PsdImage image = (PsdImage)Image.Load(sourceFileName))
{
for (int i = 0; i < 4; i++)
{
int angle = i * 45;
image.Layers[1].Rotate(angle);
string outFileName = "TheHatLayerRotated" + angle + ".png";
image.Save(outFileName, pngOptions);
}
}
See Also
- class PsdImage
- namespace Aspose.PSD.FileFormats.Psd
- assembly Aspose.PSD
Rotate(float, bool, Color)
Rotate image around the center.
public override void Rotate(float angle, bool resizeProportionally, Color backgroundColor)
Parameter | Type | Description |
---|---|---|
angle | Single | The rotate angle in degrees. Positive values will rotate clockwise. |
resizeProportionally | Boolean | if set to true you will have your image size changed according to rotated rectangle (corner points) projections in other case that leaves dimensions untouched and only internal image contents are rotated. |
backgroundColor | Color | Color of the background. |
See Also
- struct Color
- class PsdImage
- namespace Aspose.PSD.FileFormats.Psd
- assembly Aspose.PSD