BitmapCreateOptions 列挙型

定義

ビットマップ イメージの初期化オプションを指定します。

この列挙体は、メンバー値のビットごとの組み合わせをサポートしています。

public enum class BitmapCreateOptions
[System.Flags]
public enum BitmapCreateOptions
[<System.Flags>]
type BitmapCreateOptions = 
Public Enum BitmapCreateOptions
継承
BitmapCreateOptions
属性

フィールド

名前 説明
None 0

BitmapCreateOptionsは指定されません。 これが既定値です。

PreservePixelFormat 1

ファイルが格納されている PixelFormat が読み込まれるのと同じであることを確認します。

DelayCreation 2

BitmapSource オブジェクトが必要になるまで初期化を遅延させます。 これは、イメージのコレクションを処理する場合に便利です。

IgnoreColorProfile 4

埋め込まれたカラー プロファイルを BitmapSource が無視します。

IgnoreImageCache 8

既存のイメージ キャッシュを使用せずにイメージを読み込みます。 このオプションは、キャッシュ内のイメージを更新する必要がある場合にのみ選択する必要があります。

次の例では、 BitmapImage をインスタンス化し、 BitmapCreateOptions 列挙値を指定する方法を示します。

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

注釈

PreservePixelFormatが設定されていない場合、システムによって決定される内容に応じて、イメージのPixelFormatが選択され、最適なパフォーマンスが得られます。 このオプションを有効にすると、ファイル形式は保持されますが、パフォーマンスが低下する可能性があります。

IgnoreColorProfileが設定されている場合、CopyPixels(Array, Int32, Int32) などのメソッドを呼び出しても、色補正ビットは返されません。

IgnoreImageCacheが設定されている場合、イメージ キャッシュ内の既存のエントリは、同じUriを共有している場合でも置き換えられます。

適用対象

こちらもご覧ください