Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

RotateFlipType Enumeration

Specifies how much an image is rotated and the axis used to flip the image.

Namespace:  System.Drawing
Assembly:  System.Drawing (in System.Drawing.dll)
public enum RotateFlipType
Member nameDescription
RotateNoneFlipNoneSpecifies no clockwise rotation and no flipping.
Rotate90FlipNoneSpecifies a 90-degree clockwise rotation without flipping.
Rotate180FlipNoneSpecifies a 180-degree clockwise rotation without flipping.
Rotate270FlipNoneSpecifies a 270-degree clockwise rotation without flipping.
RotateNoneFlipXSpecifies no clockwise rotation followed by a horizontal flip.
Rotate90FlipXSpecifies a 90-degree clockwise rotation followed by a horizontal flip.
Rotate180FlipXSpecifies a 180-degree clockwise rotation followed by a horizontal flip.
Rotate270FlipXSpecifies a 270-degree clockwise rotation followed by a horizontal flip.
RotateNoneFlipYSpecifies no clockwise rotation followed by a vertical flip.
Rotate90FlipYSpecifies a 90-degree clockwise rotation followed by a vertical flip.
Rotate180FlipYSpecifies a 180-degree clockwise rotation followed by a vertical flip.
Rotate270FlipYSpecifies a 270-degree clockwise rotation followed by a vertical flip.
RotateNoneFlipXYSpecifies no clockwise rotation followed by a horizontal and vertical flip.
Rotate90FlipXYSpecifies a 90-degree clockwise rotation followed by a horizontal and vertical flip.
Rotate180FlipXYSpecifies a 180-degree clockwise rotation followed by a horizontal and vertical flip.
Rotate270FlipXYSpecifies a 270-degree clockwise rotation followed by a horizontal and vertical flip.

The image is rotated in a clockwise direction.

The following code example demonstrates how to set the RotateFlip property of an Image and the RotateFlipType enumeration.

This example is designed to be used with a Windows Form that contains a PictureBox named PictureBox1 and a button named Button1. Paste the code into a form, call InitializeBitmap from the form's constructor or Load event-handling method and associate Button1_Click with the button's Click event. Ensure the file path to the bitmap is valid on your system.


Bitmap bitmap1;

private void InitializeBitmap()
{
    try
    {
        bitmap1 = (Bitmap)Bitmap.FromFile(@"C:\Documents and Settings\" + 
            @"All Users\Documents\My Music\music.bmp");
        PictureBox1.SizeMode = PictureBoxSizeMode.AutoSize;
        PictureBox1.Image = bitmap1;
    }
    catch(System.IO.FileNotFoundException)
    {
        MessageBox.Show("There was an error." + 
            "Check the path to the bitmap.");
    }


}

private void Button1_Click(System.Object sender, System.EventArgs e)
{

    if (bitmap1 != null)
    {
        bitmap1.RotateFlip(RotateFlipType.Rotate180FlipY);
        PictureBox1.Image = bitmap1;
    }

}


.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.