TextureBrush.ScaleTransform Método

Definição

Dimensiona a transformação geométrica local desse objeto TextureBrush nos valores especificados.Scales the local geometric transformation of this TextureBrush object by the specified amounts. Esse método precede a matriz de escala para a transformação.This method prepends the scaling matrix to the transformation.

Sobrecargas

ScaleTransform(Single, Single)

Dimensiona a transformação geométrica local desse objeto TextureBrush nos valores especificados.Scales the local geometric transformation of this TextureBrush object by the specified amounts. Esse método precede a matriz de escala para a transformação.This method prepends the scaling matrix to the transformation.

ScaleTransform(Single, Single, MatrixOrder)

Dimensiona a transformação geométrica local desse objeto TextureBrush nos valores especificados na ordem especificada.Scales the local geometric transformation of this TextureBrush object by the specified amounts in the specified order.

ScaleTransform(Single, Single)

Dimensiona a transformação geométrica local desse objeto TextureBrush nos valores especificados.Scales the local geometric transformation of this TextureBrush object by the specified amounts. Esse método precede a matriz de escala para a transformação.This method prepends the scaling matrix to the transformation.

public:
 void ScaleTransform(float sx, float sy);
public void ScaleTransform (float sx, float sy);
member this.ScaleTransform : single * single -> unit
Public Sub ScaleTransform (sx As Single, sy As Single)

Parâmetros

sx
Single

O valor pelo qual se dimensiona a transformação na direção de x.The amount by which to scale the transformation in the x direction.

sy
Single

O valor pelo qual se dimensiona a transformação na direção de y.The amount by which to scale the transformation in the y direction.

Exemplos

O exemplo a seguir foi projetado para uso com Windows Forms e requer PaintEventArgs e , que é um parâmetro do manipulador de Paint eventos.The following example is designed for use with Windows Forms, and it requires PaintEventArgse, which is a parameter of the Paint event handler. O código executa as seguintes ações:The code performs the following actions:

  • Cria um objeto TextureBrush.Creates a TextureBrush object.

  • Dimensiona a imagem de textura duas vezes na direção x.Scales the texture image by two times in the x-direction.

  • Preenche um retângulo na tela, usando o pincel de textura.Fills a rectangle on the screen, using the texture brush.

void ScaleTransform_Example1( PaintEventArgs^ e )
{
   // Create a TextureBrush object.
   TextureBrush^ tBrush = gcnew TextureBrush( gcnew Bitmap( "texture.jpg" ) );

   // Scale the texture image 2X in the x-direction.
   tBrush->ScaleTransform( 2, 1 );

   // Fill a rectangle with tBrush.
   e->Graphics->FillRectangle( tBrush, 0, 0, 100, 100 );
}
public void ScaleTransform_Example1(PaintEventArgs e)
{
             
    // Create a TextureBrush object.
    TextureBrush tBrush = new TextureBrush(new Bitmap("texture.jpg"));
             
    // Scale the texture image 2X in the x-direction.
    tBrush.ScaleTransform(2, 1);
             
    // Fill a rectangle with tBrush.
    e.Graphics.FillRectangle(tBrush, 0, 0, 100, 100);
}
Public Sub ScaleTransform_Example1(ByVal e As PaintEventArgs)

    ' Create a TextureBrush object.
    Dim tBrush As New TextureBrush(New Bitmap("texture.jpg"))

    ' Scale the texture image 2X in the x-direction.
    tBrush.ScaleTransform(2, 1)

    ' Fill a rectangle with tBrush.
    e.Graphics.FillRectangle(tBrush, 0, 0, 100, 100)
End Sub

Aplica-se a

ScaleTransform(Single, Single, MatrixOrder)

Dimensiona a transformação geométrica local desse objeto TextureBrush nos valores especificados na ordem especificada.Scales the local geometric transformation of this TextureBrush object by the specified amounts in the specified order.

public:
 void ScaleTransform(float sx, float sy, System::Drawing::Drawing2D::MatrixOrder order);
public void ScaleTransform (float sx, float sy, System.Drawing.Drawing2D.MatrixOrder order);
member this.ScaleTransform : single * single * System.Drawing.Drawing2D.MatrixOrder -> unit
Public Sub ScaleTransform (sx As Single, sy As Single, order As MatrixOrder)

Parâmetros

sx
Single

O valor pelo qual se dimensiona a transformação na direção de x.The amount by which to scale the transformation in the x direction.

sy
Single

O valor pelo qual se dimensiona a transformação na direção de y.The amount by which to scale the transformation in the y direction.

order
MatrixOrder

Uma enumeração MatrixOrder que especifica se a matriz de escala deve ser acrescentada ou precedida.A MatrixOrder enumeration that specifies whether to append or prepend the scaling matrix.

Exemplos

O exemplo a seguir foi projetado para uso com Windows Forms e requer PaintEventArgs e , que é um parâmetro do manipulador de Paint eventos.The following example is designed for use with Windows Forms, and it requires PaintEventArgse, which is a parameter of the Paint event handler. O código executa as seguintes ações:The code performs the following actions:

  • Cria um objeto TextureBrush.Creates a TextureBrush object.

  • Dimensiona a imagem de textura duas vezes na direção x.Scales the texture image by two times in the x-direction.

  • Preenche um retângulo na tela, usando o pincel de textura.Fills a rectangle on the screen, using the texture brush.

void ScaleTransform_Example2( PaintEventArgs^ e )
{
   // Create a TextureBrush object.
   TextureBrush^ tBrush = gcnew TextureBrush( gcnew Bitmap( "texture.jpg" ) );

   // Scale the texture image 2X in the x-direction.
   tBrush->ScaleTransform( 2, 1, MatrixOrder::Prepend );

   // Fill a rectangle with tBrush.
   e->Graphics->FillRectangle( tBrush, 0, 0, 100, 100 );
}
public void ScaleTransform_Example2(PaintEventArgs e)
{
             
    // Create a TextureBrush object.
    TextureBrush tBrush = new TextureBrush(new Bitmap("texture.jpg"));
             
    // Scale the texture image 2X in the x-direction.
    tBrush.ScaleTransform(2, 1, MatrixOrder.Prepend);
             
    // Fill a rectangle with tBrush.
    e.Graphics.FillRectangle(tBrush, 0, 0, 100, 100);
}
Public Sub ScaleTransform_Example2(ByVal e As PaintEventArgs)

    ' Create a TextureBrush object.
    Dim tBrush As New TextureBrush(New Bitmap("texture.jpg"))

    ' Scale the texture image 2X in the x-direction.
    tBrush.ScaleTransform(2, 1, MatrixOrder.Prepend)

    ' Fill a rectangle with tBrush.
    e.Graphics.FillRectangle(tBrush, 0, 0, 100, 100)
End Sub

Aplica-se a