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 の場合に発生します。

次のコード例は、in コードを作成して使用する方法を 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()

適用対象

こちらもご覧ください