TransformedBitmap.BeginInit Método
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Sinaliza o início da TransformedBitmap inicialização.
public:
virtual void BeginInit();
public void BeginInit();
abstract member BeginInit : unit -> unit
override this.BeginInit : unit -> unit
Public Sub BeginInit ()
Implementações
Exceções
Está TransformedBitmap atualmente a ser inicializado. BeginInit() já foi chamado.
-ou-
Já TransformedBitmap foi inicializado.
Exemplos
O exemplo seguinte demonstra como inicializar a TransformedBitmap com um conjunto de propriedades usando os BeginInit métodos e.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()
Observações
A inicialização de propriedades deve ser feita entre BeginInit as chamadas de and EndInit . Uma vez inicializado, TransformedBitmap as alterações de propriedade são ignoradas.