BitmapImage.CreateOptions Proprietà

Definizione

Ottiene o imposta l'oggetto BitmapCreateOptions per un oggetto 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

Valore della proprietà

Oggetto BitmapCreateOptions utilizzato per questo oggetto BitmapImage Il valore predefinito è None.

Esempio

Nell'esempio di codice seguente viene illustrato come impostare l'oggetto CreateOptions di un BitmapImage usando il codice.

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

Informazioni proprietà di dipendenza

Campo Identificatore CreateOptionsProperty
Proprietà dei metadati impostate su true Nessuno

Si applica a

Vedi anche