RotateFlipType Enumeration
Specifies the direction of an image's rotation and the axis used to flip the image.
Assembly: System.Drawing (in System.Drawing.dll)
| Member name | Description | |
|---|---|---|
| RotateNoneFlipNone | Specifies no rotation and no flipping. | |
| Rotate90FlipNone | Specifies a 90-degree rotation without flipping. | |
| Rotate180FlipNone | Specifies a 180-degree rotation without flipping. | |
| Rotate270FlipNone | Specifies a 270-degree rotation without flipping. | |
| RotateNoneFlipX | Specifies no rotation followed by a horizontal flip. | |
| Rotate90FlipX | Specifies a 90-degree rotation followed by a horizontal flip. | |
| Rotate180FlipX | Specifies a 180-degree rotation followed by a horizontal flip. | |
| Rotate270FlipX | Specifies a 270-degree rotation followed by a horizontal flip. | |
| RotateNoneFlipY | Specifies no rotation followed by a vertical flip. | |
| Rotate90FlipY | Specifies a 90-degree rotation followed by a vertical flip. | |
| Rotate180FlipY | Specifies a 180-degree rotation followed by a vertical flip. | |
| Rotate270FlipY | Specifies a 270-degree rotation followed by a vertical flip. | |
| RotateNoneFlipXY | Specifies no rotation followed by a horizontal and vertical flip. | |
| Rotate90FlipXY | Specifies a 90-degree rotation followed by a horizontal and vertical flip. | |
| Rotate180FlipXY | Specifies a 180-degree rotation followed by a horizontal and vertical flip. | |
| Rotate270FlipXY | Specifies a 270-degree rotation followed by a horizontal and vertical flip. |
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.
Dim bitmap1 As Bitmap Private Sub InitializeBitmap() Try bitmap1 = CType(Bitmap.FromFile("C:\Documents and Settings\All Users\" _ & "Documents\My Music\music.bmp"), Bitmap) PictureBox1.SizeMode = PictureBoxSizeMode.AutoSize PictureBox1.Image = bitmap1 Catch ex As System.IO.FileNotFoundException MessageBox.Show("There was an error. Check the path to the bitmap.") End Try End Sub Private Sub Button1_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles Button1.Click If bitmap1 IsNot Nothing Then bitmap1.RotateFlip(RotateFlipType.Rotate180FlipY) PictureBox1.Image = bitmap1 End If End Sub
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.