Rotation Enumerazione

Definizione

Specifica la rotazione da applicare a un'immagine bitmap.

public enum class Rotation
public enum Rotation
type Rotation = 
Public Enum Rotation
Ereditarietà
Rotation

Campi

Rotate0 0

La bitmap non viene ruotata. Rappresenta il valore predefinito.

Rotate180 2

Ruota la bitmap di 180 gradi in senso orario.

Rotate270 3

Ruota la bitmap di 270 gradi in senso orario.

Rotate90 1

Ruota la bitmap di 90 gradi in senso orario.

Esempio

Nell'esempio seguente viene illustrato come applicare una rotazione a un'immagine 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)

Commenti

Sono supportati solo incrementi di 90 gradi.

Si applica a

Vedi anche