WriteableBitmap クラス

定義

書き込みおよび更新できる BitmapSource を提供します。

public ref class WriteableBitmap sealed : BitmapSource
/// [Windows.Foundation.Metadata.Activatable(Microsoft.UI.Xaml.Media.Imaging.IWriteableBitmapFactory, 65536, "Microsoft.UI.Xaml.WinUIContract")]
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.UI.Xaml.WinUIContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class WriteableBitmap final : BitmapSource
[Windows.Foundation.Metadata.Activatable(typeof(Microsoft.UI.Xaml.Media.Imaging.IWriteableBitmapFactory), 65536, "Microsoft.UI.Xaml.WinUIContract")]
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.UI.Xaml.WinUIContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class WriteableBitmap : BitmapSource
Public NotInheritable Class WriteableBitmap
Inherits BitmapSource
継承
Object Platform::Object IInspectable DependencyObject ImageSource BitmapSource WriteableBitmap
属性

C# と C++/WinRT のコード例については、「 WriteableBitmap.PixelBuffer」を参照してください。

注釈

WriteableBitmap のイメージ ソース データは、基になるピクセル バッファーです。

WriteableBitmap.PixelBuffer によって返される IBuffer を直接書き込むことができません。 ただし、言語固有の手法を使用して、バッファー内の基になるピクセル コンテンツに書き込むことができます。 詳細については、WriteableBitmap.PixelBuffer「解説」セクションを参照してください。

以前の XAML フレームワークで WriteableBitmap クラスを使用したシナリオの一部は、代わりに RenderTargetBitmap クラスを使用してWindows ランタイムで実現できます。 詳細については、「 RenderTargetBitmap」を参照してください。

コンストラクター

名前 説明
WriteableBitmap(Int32, Int32)

WriteableBitmap クラスの新しいインスタンスを初期化します。

プロパティ

名前 説明
Dispatcher

Windows アプリ SDK アプリで常に null を返します。 代わりに DispatcherQueue を使用してください。

(継承元 DependencyObject)
DispatcherQueue

このオブジェクトが関連付けられている DispatcherQueue を取得します。 DispatcherQueueは、コードが非 UI スレッドによって開始された場合でも、UI スレッド上のDependencyObjectにアクセスできる機能を表します。

(継承元 DependencyObject)
PixelBuffer

WriteableBitmap の各ピクセルが書き込まれる直接バッファーへのアクセスを取得します。

PixelHeight

ビットマップの高さをピクセル単位で取得します。

(継承元 BitmapSource)
PixelWidth

ビットマップの幅をピクセル単位で取得します。

(継承元 BitmapSource)

メソッド

名前 説明
ClearValue(DependencyProperty)

依存関係プロパティのローカル値をクリアします。

(継承元 DependencyObject)
GetAnimationBaseValue(DependencyProperty)

依存関係プロパティに対して確立された基本値を返します。これは、アニメーションがアクティブでない場合に適用されます。

(継承元 DependencyObject)
GetValue(DependencyProperty)

DependencyObject から依存関係プロパティの現在の有効な値を返します。

(継承元 DependencyObject)
Invalidate()

ビットマップ全体の描画または再描画を要求します。

ReadLocalValue(DependencyProperty)

ローカル値が設定されている場合は、依存関係プロパティのローカル値を返します。

(継承元 DependencyObject)
RegisterPropertyChangedCallback(DependencyProperty, DependencyPropertyChangedCallback)

この DependencyObject インスタンスの特定の DependencyProperty への変更をリッスンするための通知関数を登録します。

(継承元 DependencyObject)
SetSource(IRandomAccessStream)

ストリームにアクセスして BitmapSource のソース イメージを設定します。 ほとんどの呼び出し元では、代わりに SetSourceAsync を使用する必要があります。

(継承元 BitmapSource)
SetSourceAsync(IRandomAccessStream)

ストリームにアクセスし、結果を非同期的に処理することで 、BitmapSource のソース イメージを設定します。

(継承元 BitmapSource)
SetValue(DependencyProperty, Object)

DependencyObject の依存関係プロパティのローカル値を設定します。

(継承元 DependencyObject)
UnregisterPropertyChangedCallback(DependencyProperty, Int64)

RegisterPropertyChangedCallback を呼び出して以前に登録した変更通知を取り消します。

(継承元 DependencyObject)

適用対象

こちらもご覧ください