語言

TransformedBitmap.EndInit 方法

定義

表示初始化結束 BitmapImage 。

public:
 virtual void EndInit();
[System.Security.SecurityCritical]
public void EndInit();
public void EndInit();
[<System.Security.SecurityCritical>]
abstract member EndInit : unit -> unit
override this.EndInit : unit -> unit
abstract member EndInit : unit -> unit
override this.EndInit : unit -> unit
Public Sub EndInit ()

實作

屬性

例外狀況

或Source性質為 。Transformnull

-或-

這個轉換並不是正交轉換。

-或-

EndInit()該方法在未先呼叫 BeginInit()的情況下被呼叫。

範例

以下範例示範如何利用 TransformedBitmap and BeginInit 方法初始EndInit化一組屬性。

// 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()

備註

屬性初始化必須在 和 BeginInit 呼叫之間EndInit進行。 一旦 TransformedBitmap 初始化,屬性變更就會被忽略。

適用於

另請參閱