TransformedBitmap.BeginInit メソッド

定義

TransformedBitmap の初期化の開始を通知します。

public:
 virtual void BeginInit();
public void BeginInit ();
abstract member BeginInit : unit -> unit
override this.BeginInit : unit -> unit
Public Sub BeginInit ()

実装

例外

TransformedBitmap は現在初期化中です。 BeginInit() が既に呼び出されています。

- または -

TransformedBitmap は既に初期化されています。

次の例では、 メソッドと EndInit メソッドを使用して、 プロパティのセットを使用して をBeginInit初期化TransformedBitmapする方法を示します。

// Create the new BitmapSource that will be used to scale the size of the source.
TransformedBitmap myRotatedBitmapSource = new TransformedBitmap();

// BitmapSource objects like TransformedBitmap can only have their properties
// changed within a BeginInit/EndInit block.
myRotatedBitmapSource.BeginInit();

// Use the BitmapSource object defined above as the source for this BitmapSource.
// This creates a "chain" of BitmapSource objects which essentially inherit from each other.
myRotatedBitmapSource.Source = myBitmapImage;

// Flip the source 90 degrees.
myRotatedBitmapSource.Transform = new RotateTransform(90);
myRotatedBitmapSource.EndInit();
' Create the new BitmapSource that will be used to scale the size of the source.
Dim myRotatedBitmapSource As New TransformedBitmap()

' BitmapSource objects like TransformedBitmap can only have their properties
' changed within a BeginInit/EndInit block.
myRotatedBitmapSource.BeginInit()

' Use the BitmapSource object defined above as the source for this BitmapSource.
' This creates a "chain" of BitmapSource objects which essentially inherit from each other.
myRotatedBitmapSource.Source = myBitmapImage

' Flip the source 90 degrees.
myRotatedBitmapSource.Transform = New RotateTransform(90)
myRotatedBitmapSource.EndInit()

注釈

プロパティの初期化は、 と 呼び出しの間 BeginInitEndInit 行う必要があります。 TransformedBitmapが初期化されると、プロパティの変更は無視されます。

適用対象

こちらもご覧ください