Språk

Rotation Enum

Definition

Anger rotationen som ska tillämpas på en bitmappsbild.

public enum class Rotation
public enum Rotation
type Rotation = 
Public Enum Rotation
Arv
Rotation

Fält

Name Värde Description
Rotate0 0

Bitmappen roteras inte. Det här är standardvärdet.

Rotate90 1

Rotera bitmappen medsols med 90 grader.

Rotate180 2

Rotera bitmappen medsols med 180 grader.

Rotate270 3

Rotera bitmappen medsols med 270 grader.

Exempel

I följande exempel visas hur du tillämpar en rotation på en bitmappsbild.

// 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)

Kommentarer

Endast steg på 90 grader stöds.

Gäller för

Se även