Rotation Énumération

Définition

Spécifie la rotation à appliquer à une image bitmap.

public enum class Rotation
public enum Rotation
type Rotation = 
Public Enum Rotation
Héritage
Rotation

Champs

Nom Valeur Description
Rotate0 0

La bitmap n’est pas pivotée. Il s’agit de la valeur par défaut.

Rotate90 1

Faites pivoter la bitmap dans le sens des aiguilles d’une montre de 90 degrés.

Rotate180 2

Faites pivoter la bitmap dans le sens des aiguilles d’une montre de 180 degrés.

Rotate270 3

Faites pivoter la bitmap dans le sens des aiguilles d’une montre de 270 degrés.

Exemples

L’exemple suivant montre comment appliquer une rotation à une image bitmap.

// 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);
' Define a BitmapImage.
Dim myImage As New Image()
Dim bi As 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)

Remarques

Seuls les incréments de 90 degrés sont pris en charge.

S’applique à

Voir aussi