TextureBrush.ScaleTransform Método

Definição

Dimensiona a transformação geométrica local desse objeto TextureBrush nos valores especificados. Esse método precede a matriz de escala para a transformação.

Sobrecargas

ScaleTransform(Single, Single)

Dimensiona a transformação geométrica local desse objeto TextureBrush nos valores especificados. Esse método precede a matriz de escala para a transformação.

ScaleTransform(Single, Single, MatrixOrder)

Dimensiona a transformação geométrica local desse objeto TextureBrush nos valores especificados na ordem especificada.

ScaleTransform(Single, Single)

Dimensiona a transformação geométrica local desse objeto TextureBrush nos valores especificados. Esse método precede a matriz de escala para a transformação.

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.

sy
Single

O valor pelo qual se dimensiona a transformação na direção de y.

Exemplos

O exemplo a seguir foi projetado para uso com Windows Forms e requer PaintEventArgs e, que é um parâmetro do Paint manipulador de eventos. O código executa as seguintes ações:

  • Cria um objeto TextureBrush.

  • Dimensiona a imagem de textura em duas vezes na direção x.

  • Preenche um retângulo na tela, usando o pincel de textura.

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.

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.

sy
Single

O valor pelo qual se dimensiona a transformação na direção de y.

order
MatrixOrder

Uma enumeração MatrixOrder que especifica se a matriz de escala deve ser acrescentada ou precedida.

Exemplos

O exemplo a seguir foi projetado para uso com Windows Forms e requer PaintEventArgs e, que é um parâmetro do Paint manipulador de eventos. O código executa as seguintes ações:

  • Cria um objeto TextureBrush.

  • Dimensiona a imagem de textura em duas vezes na direção x.

  • Preenche um retângulo na tela, usando o pincel de textura.

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