Rotation 列舉

定義

指定要套用至點陣圖影像的旋轉。Specifies the rotation to apply to a bitmap image.

public enum class Rotation
public enum Rotation
type Rotation = 
Public Enum Rotation
繼承
Rotation

欄位

Rotate0 0

不旋轉點陣圖。The bitmap is not rotated. 這是預設值。This is the default value.

Rotate180 2

將點陣圖順時針旋轉 180 度。Rotate the bitmap clockwise by 180 degrees.

Rotate270 3

將點陣圖順時針旋轉 270 度。Rotate the bitmap clockwise by 270 degrees.

Rotate90 1

將點陣圖順時針旋轉 90 度。Rotate the bitmap clockwise by 90 degrees.

範例

下列範例示範如何將旋轉套用至點陣圖影像。The following example demonstrates how to apply a rotation to a bitmap image.

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

備註

只支援 90 度遞增。Only 90 degree increments are supported.

適用於

另請參閱