RasterCachedImage.RotateFlip

RasterCachedImage.RotateFlip method

旋转、翻转或同时旋转和翻转图像。

public override void RotateFlip(RotateFlipType rotateFlipType)
参数类型描述
rotateFlipTypeRotateFlipType旋转翻转类型。

示例

此示例加载一个栅格缓存图像,将其顺时针旋转90度,并可选地水平和(或)垂直翻转图像。

[C#]

string dir = "c:\\temp\\";

Aspose.Imaging.RotateFlipType[] rotateFlipTypes = new Aspose.Imaging.RotateFlipType[]
{
    Aspose.Imaging.RotateFlipType.Rotate90FlipNone,
    Aspose.Imaging.RotateFlipType.Rotate90FlipX,
    Aspose.Imaging.RotateFlipType.Rotate90FlipXY,
    Aspose.Imaging.RotateFlipType.Rotate90FlipY,
};

foreach (Aspose.Imaging.RotateFlipType rotateFlipType in rotateFlipTypes)
{
    // 旋转、翻转并保存到输出文件。
    using (Aspose.Imaging.RasterCachedImage image = (Aspose.Imaging.RasterCachedImage)Aspose.Imaging.Image.Load(dir + "sample.bmp"))
    {
        image.RotateFlip(rotateFlipType);
        image.Save(dir + "sample." + rotateFlipType + ".bmp");
    }
}

另请参见