WriteableBitmap クラス

定義

に書き込んで更新できる BitmapSource を提供します。

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

Windows の要件

デバイス ファミリ
Windows 10 (10.0.10240.0 で導入)
API contract
Windows.Foundation.UniversalApiContract (v1.0 で導入)

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

注釈

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

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

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

コンストラクター

WriteableBitmap(Int32, Int32)

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

プロパティ

Dispatcher

このオブジェクトが関連付けられている CoreDispatcher を取得します。 CoreDispatcher は、コードが 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)

適用対象

こちらもご覧ください