Compartir a través de


TransformedBitmap.EndInit Método

Definición

Señala el final de la inicialización de 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 ()

Implementaciones

Atributos

Excepciones

El valor de las propiedades Source o Transform es null.

o bien La transformación no es una transformación ortogonal.

o bien Se llamó al método EndInit() sin llamar primero a BeginInit().

Ejemplos

En el ejemplo siguiente se muestra cómo inicializar un TransformedBitmap objeto con un conjunto de propiedades mediante los BeginInit métodos y 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()

Comentarios

La inicialización de propiedades debe realizarse entre BeginInit las llamadas y EndInit . TransformedBitmap Una vez inicializado , se omiten los cambios de propiedad.

Se aplica a

Consulte también