Partilhar via


TextureBrush.ScaleTransform Método

Definição

Dimensiona a transformação geométrica local desse objeto TextureBrush pelos valores especificados. Esse método prepara a matriz de dimensionamento para a transformação.

Sobrecargas

ScaleTransform(Single, Single)

Dimensiona a transformação geométrica local desse objeto TextureBrush pelos valores especificados. Esse método prepara a matriz de dimensionamento para a transformação.

ScaleTransform(Single, Single, MatrixOrder)

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

ScaleTransform(Single, Single)

Origem:
TextureBrush.cs
Origem:
TextureBrush.cs
Origem:
TextureBrush.cs
Origem:
TextureBrush.cs
Origem:
TextureBrush.cs

Dimensiona a transformação geométrica local desse objeto TextureBrush pelos valores especificados. Esse método prepara a matriz de dimensionamento 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

A quantidade pela qual dimensionar a transformação na direção x.

sy
Single

A quantidade pela qual dimensionar a transformação na direção y.

Exemplos

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

  • Cria um objeto TextureBrush.

  • Dimensiona a imagem de textura 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)

Origem:
TextureBrush.cs
Origem:
TextureBrush.cs
Origem:
TextureBrush.cs
Origem:
TextureBrush.cs
Origem:
TextureBrush.cs

Dimensiona a transformação geométrica local desse objeto TextureBrush pelos 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

A quantidade pela qual dimensionar a transformação na direção x.

sy
Single

A quantidade pela qual dimensionar a transformação na direção y.

order
MatrixOrder

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

Exemplos

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

  • Cria um objeto TextureBrush.

  • Dimensiona a imagem de textura 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