共用方式為


BitmapImage.CreateOptions 屬性

定義

取得或設定 BitmapCreateOptionsBitmapImage

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

屬性值

用於這個 BitmapCreateOptionsBitmapImage。 預設為 None

範例

下列程式碼範例示範如何使用程式碼來設定 CreateOptionsBitmapImage

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

備註

相依性屬性資訊

識別碼欄位 CreateOptionsProperty
中繼資料屬性設定為 true

適用於

另請參閱