Ler en inglés

Compartir por


Rotation Enumeración

Definición

Especifica la rotación que se aplicará a una imagen de mapa de bits.

C#
public enum Rotation
Herencia
Rotation

Campos

Rotate0 0

No se gira el mapa de bits. Este es el valor predeterminado.

Rotate180 2

Gira el mapa de bits en el sentido de las agujas del reloj 180 grados.

Rotate270 3

Gira el mapa de bits en el sentido de las agujas del reloj 270 grados.

Rotate90 1

Gira el mapa de bits en el sentido de las agujas del reloj 90 grados.

Ejemplos

En el ejemplo siguiente se muestra cómo aplicar una rotación a una imagen de mapa de bits.

C#
// Define a BitmapImage.
Image myImage = new Image();
BitmapImage bi = new BitmapImage();

// Begin initialization.
bi.BeginInit();

// Set properties.
bi.CacheOption = BitmapCacheOption.OnDemand;
bi.CreateOptions = BitmapCreateOptions.DelayCreation;
bi.DecodePixelHeight = 125;
bi.DecodePixelWidth = 125;
bi.Rotation = Rotation.Rotate90;
MessageBox.Show(bi.IsDownloading.ToString());
bi.UriSource = new Uri("smiley.png", UriKind.Relative);

// End initialization.
bi.EndInit();
myImage.Source = bi;
myImage.Stretch = Stretch.None;
myImage.Margin = new Thickness(5);

Comentarios

Se admiten solo incrementos de 90 grados.

Se aplica a

Produto Versións
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8
Windows Desktop 3.0, 3.1, 5, 6, 7

Consulte también