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 или Transform имеет значение null.

-или- Трансформация не является декартовой.

-или- Метод EndInit() вызывается без предварительного вызова BeginInit().

Примеры

В следующем примере показано, как инициализировать TransformedBitmap набор свойств с помощью 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 После инициализации изменения свойств игнорируются.

Применяется к

См. также раздел