CachedBitmap(BitmapSource, BitmapCreateOptions, BitmapCacheOption) コンストラクター

定義

指定したソース、ビットマップ作成オプション、およびビットマップ キャッシュ オプションを持つ CachedBitmap の新しいインスタンスを初期化します。

public:
 CachedBitmap(System::Windows::Media::Imaging::BitmapSource ^ source, System::Windows::Media::Imaging::BitmapCreateOptions createOptions, System::Windows::Media::Imaging::BitmapCacheOption cacheOption);
public CachedBitmap(System.Windows.Media.Imaging.BitmapSource source, System.Windows.Media.Imaging.BitmapCreateOptions createOptions, System.Windows.Media.Imaging.BitmapCacheOption cacheOption);
new System.Windows.Media.Imaging.CachedBitmap : System.Windows.Media.Imaging.BitmapSource * System.Windows.Media.Imaging.BitmapCreateOptions * System.Windows.Media.Imaging.BitmapCacheOption -> System.Windows.Media.Imaging.CachedBitmap
Public Sub New (source As BitmapSource, createOptions As BitmapCreateOptions, cacheOption As BitmapCacheOption)

パラメーター

source
BitmapSource

キャッシュされるソース ビットマップ。

createOptions
BitmapCreateOptions

ビットマップ イメージの初期化オプション。

cacheOption
BitmapCacheOption

ビットマップをメモリにキャッシュする方法を指定します。

例外

sourcenullされたときに発生します。

次のコード例は、コードで CachedBitmap を作成して使用する方法を示しています。


CachedBitmap cachedSource = new CachedBitmap(
    scaledSource, 
    BitmapCreateOptions.None,
    BitmapCacheOption.OnLoad);


// Create a new BitmapSource using a different format than the original one.
FormatConvertedBitmap newFormatSource = new FormatConvertedBitmap();
newFormatSource.BeginInit();
newFormatSource.Source = cachedSource;
newFormatSource.DestinationFormat = PixelFormats.Gray32Float;
newFormatSource.EndInit();
Dim cachedSource As New CachedBitmap(scaledSource, BitmapCreateOptions.None, BitmapCacheOption.OnLoad)
' Create a new BitmapSource using a different format than the original one.
Dim newFormatSource As New FormatConvertedBitmap()
newFormatSource.BeginInit()
newFormatSource.Source = cachedSource
newFormatSource.DestinationFormat = PixelFormats.Gray32Float
newFormatSource.EndInit()

適用対象

こちらもご覧ください