Taal

Rotation Enum

Definitie

Hiermee geeft u de draaiing op die moet worden toegepast op een bitmapafbeelding.

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

Velden

Naam Waarde Description
Rotate0 0

De bitmap wordt niet gedraaid. Dit is de standaardwaarde.

Rotate90 1

Draai de bitmap met de klok mee met 90 graden.

Rotate180 2

Draai de bitmap met de klok mee met 180 graden.

Rotate270 3

Draai de bitmap met de klok mee met 270 graden.

Voorbeelden

In het volgende voorbeeld ziet u hoe u een draaiing toepast op een bitmapafbeelding.

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

Opmerkingen

Er worden slechts 90 graden incrementen ondersteund.

Van toepassing op

Zie ook