TransformedBitmap.EndInit Método
Definição
Importante
Algumas informações se referem a produtos de pré-lançamento que podem ser substancialmente modificados antes do lançamento. A Microsoft não oferece garantias, expressas ou implícitas, das informações aqui fornecidas.
Sinaliza o fim da BitmapImage inicialização.
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 ()
Implementações
- Atributos
Exceções
As Source propriedades ou as Transform propriedades são null.
- ou -
A transformação não é uma transformação ortogonal.
- ou -
O EndInit() método é chamado sem chamar BeginInit()primeiro.
Exemplos
O exemplo a seguir demonstra como inicializar um TransformedBitmap com um conjunto de propriedades usando os métodos e BeginInit os EndInit métodos.
// 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()
Comentários
A inicialização da propriedade deve ser feita entre BeginInit chamadas e EndInit entre elas. Depois que a TransformedBitmap propriedade for inicializada, as alterações de propriedade serão ignoradas.