BitmapImage.CreateOptions Propiedad

Definición

Obtiene o establece la propiedad BitmapCreateOptions de una clase BitmapImage.

public:
 property System::Windows::Media::Imaging::BitmapCreateOptions CreateOptions { System::Windows::Media::Imaging::BitmapCreateOptions get(); void set(System::Windows::Media::Imaging::BitmapCreateOptions value); };
public System.Windows.Media.Imaging.BitmapCreateOptions CreateOptions { get; set; }
member this.CreateOptions : System.Windows.Media.Imaging.BitmapCreateOptions with get, set
Public Property CreateOptions As BitmapCreateOptions

Valor de propiedad

La enumeración BitmapCreateOptions usada para esta clase BitmapImage. De manera predeterminada, es None.

Ejemplos

En el ejemplo de código siguiente se muestra cómo establecer el CreateOptions de mediante BitmapImage código .

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

Comentarios

Información sobre propiedades de dependencia

Campo identificador CreateOptionsProperty
Propiedades de metadatos establecidas en true Ninguno

Se aplica a

Consulte también