TextureBrush.ScaleTransform 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.
Escala a transformação geométrica local deste TextureBrush objeto pelas quantidades especificadas. Este método antepõe a matriz de escala à transformação.
Sobrecargas
| Name | Description |
|---|---|
| ScaleTransform(Single, Single) |
Escala a transformação geométrica local deste TextureBrush objeto pelas quantidades especificadas. Este método antepõe a matriz de escala à transformação. |
| ScaleTransform(Single, Single, MatrixOrder) |
Escala a transformação geométrica local deste TextureBrush objeto pelas quantidades especificadas na ordem especificada. |
ScaleTransform(Single, Single)
Escala a transformação geométrica local deste TextureBrush objeto pelas quantidades especificadas. Este método antepõe a matriz de escala à 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 escalar a transformação na direção x.
- sy
- Single
A quantidade pela qual escalar a transformação na direção y.
Exemplos
O exemplo seguinte foi concebido para uso com Windows Forms e requer PaintEventArgse, que é um parâmetro do handler de eventos Paint. O código executa as seguintes ações:
Cria um objeto TextureBrush.
Escala a imagem da textura por duas vezes na direção x.
Preenche um retângulo no ecrã, 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)
Escala a transformação geométrica local deste TextureBrush objeto pelas quantidades especificadas 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 x.
- sy
- Single
A quantidade pela qual escalar a transformação na direção y.
- order
- MatrixOrder
Uma MatrixOrder enumeração que especifica se deve anexar ou antepender a matriz de escalabilidade.
Exemplos
O exemplo seguinte foi concebido para uso com Windows Forms e requer PaintEventArgse, que é um parâmetro do handler de eventos Paint. O código executa as seguintes ações:
Cria um objeto TextureBrush.
Escala a imagem da textura por duas vezes na direção x.
Preenche um retângulo no ecrã, 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