LinearGradientBrush.ScaleTransform Método

Definição

Escala a transformada geométrica local pelas quantidades especificadas. Este método antepõe a matriz de escala à transformada.

Sobrecargas

Name Description
ScaleTransform(Single, Single)

Escala a transformada geométrica local pelas quantidades especificadas. Este método antepõe a matriz de escala à transformada.

ScaleTransform(Single, Single, MatrixOrder)

Escala a transformação geométrica local pelos valores especificados na ordem especificada.

ScaleTransform(Single, Single)

Origem:
LinearGradientBrush.cs
Origem:
LinearGradientBrush.cs
Origem:
LinearGradientBrush.cs
Origem:
LinearGradientBrush.cs
Origem:
LinearGradientBrush.cs
Origem:
LinearGradientBrush.cs
Origem:
LinearGradientBrush.cs
Origem:
LinearGradientBrush.cs

Escala a transformada geométrica local pelas quantidades especificadas. Este método antepõe a matriz de escala à transformada.

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 escalar a transformação na direção do eixo x.

sy
Single

A quantidade pela qual escalar a transformação na direção do eixo y.

Exemplos

Para obter um exemplo, consulte ScaleTransform.

Aplica-se a

ScaleTransform(Single, Single, MatrixOrder)

Origem:
LinearGradientBrush.cs
Origem:
LinearGradientBrush.cs
Origem:
LinearGradientBrush.cs
Origem:
LinearGradientBrush.cs
Origem:
LinearGradientBrush.cs
Origem:
LinearGradientBrush.cs
Origem:
LinearGradientBrush.cs
Origem:
LinearGradientBrush.cs

Escala a transformação geométrica local 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 escalar a transformação na direção do eixo x.

sy
Single

A quantidade pela qual escalar a transformação na direção do eixo y.

order
MatrixOrder

A MatrixOrder que especifica se deve anexar ou antepender a matriz de escalabilidade.

Exemplos

O seguinte exemplo de código foi concebido para uso com Windows Forms e requer PaintEventArgse, um objeto de evento OnPaint. O código executa as seguintes ações:

  • Cria um novo LinearGradientBrush.

  • Desenhe uma elipse para o ecrã usando este pincel.

  • Escala o LinearGradientBrush por um fator de dois no eixo x.

  • Desenha uma elipse para o ecrã diretamente abaixo da primeira elipse, usando o pincel escamado.

Note-se que o gradiente da elipse inferior é esticado por um fator de dois. Note-se também que uma chamada ao TranslateTransform método é usada para justificar a aresta esquerda do preenchimento do gradiente com a aresta esquerda da elipse.

private:
   void ScaleTransformExample( PaintEventArgs^ e )
   {
      // Create a LinearGradientBrush.
      Rectangle myRect = Rectangle(20,20,200,100);
      LinearGradientBrush^ myLGBrush = gcnew LinearGradientBrush( myRect,Color::Blue,Color::Red,0.0f,true );

      // Draw an ellipse to the screen using the LinearGradientBrush.
      e->Graphics->FillEllipse( myLGBrush, myRect );

      // Scale the LinearGradientBrush.
      myLGBrush->ScaleTransform( 2.0f, 1.0f, MatrixOrder::Prepend );

      // Rejustify the brush to start at the left edge of the ellipse.
      myLGBrush->TranslateTransform(  -20.0f, 0.0f );

      // Draw a second ellipse to the screen using
      // the transformed brush.
      e->Graphics->FillEllipse( myLGBrush, 20, 150, 200, 100 );
   }
private void ScaleTransformExample(PaintEventArgs e)
{
             
    // Create a LinearGradientBrush.
    Rectangle myRect = new Rectangle(20, 20, 200, 100);
    LinearGradientBrush myLGBrush = new LinearGradientBrush(
        myRect, Color.Blue, Color.Red,  0.0f, true);
             
    // Draw an ellipse to the screen using the LinearGradientBrush.
    e.Graphics.FillEllipse(myLGBrush, myRect);
             
    // Scale the LinearGradientBrush.
    myLGBrush.ScaleTransform(2.0f, 1.0f, MatrixOrder.Prepend);
   
    // Rejustify the brush to start at the left edge of the ellipse.
    myLGBrush.TranslateTransform(-20.0f, 0.0f);
             
    // Draw a second ellipse to the screen using
    // the transformed brush.
    e.Graphics.FillEllipse(myLGBrush, 20, 150, 200, 100);
}
Public Sub ScaleTransformExample(ByVal e As PaintEventArgs)

    ' Create a LinearGradientBrush.
    Dim myRect As New Rectangle(20, 20, 200, 100)
    Dim myLGBrush As New LinearGradientBrush(myRect, Color.Blue, _
    Color.Red, 0.0F, True)

    ' Draw an ellipse to the screen using the LinearGradientBrush.
    e.Graphics.FillEllipse(myLGBrush, myRect)

    ' Scale the LinearGradientBrush.
    myLGBrush.ScaleTransform(2.0F, 1.0F, MatrixOrder.Prepend)

    ' Rejustify the brush to start at the left edge of the ellipse.
    myLGBrush.TranslateTransform(-20.0F, 0.0F)

    ' Draw a second ellipse to the screen using the transformed brush.
    e.Graphics.FillEllipse(myLGBrush, 20, 150, 200, 100)
End Sub

Aplica-se a