TextureBrush.ScaleTransform Metodo
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Scala la trasformazione geometrica locale di questo oggetto TextureBrush in base al valore specificato. Il metodo antepone la matrice di scala alla trasformazione.
Overload
ScaleTransform(Single, Single) |
Scala la trasformazione geometrica locale di questo oggetto TextureBrush in base al valore specificato. Il metodo antepone la matrice di scala alla trasformazione. |
ScaleTransform(Single, Single, MatrixOrder) |
Scala la trasformazione geometrica locale di questo oggetto TextureBrush in base agli importi specificati nell'ordine indicato. |
ScaleTransform(Single, Single)
- Origine:
- TextureBrush.cs
- Origine:
- TextureBrush.cs
- Origine:
- TextureBrush.cs
Scala la trasformazione geometrica locale di questo oggetto TextureBrush in base al valore specificato. Il metodo antepone la matrice di scala alla trasformazione.
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)
Parametri
- sx
- Single
Importo in base al quale scalare la trasformazione nella direzione dell'asse X.
- sy
- Single
Importo in base al quale scalare la trasformazione nella direzione dell'asse Y.
Esempio
L'esempio seguente è progettato per l'uso con Windows Forms e richiede PaintEventArgse
, che è un parametro del Paint
gestore eventi. Il codice esegue le azioni seguenti:
Crea un oggetto TextureBrush.
Ridimensiona l'immagine della trama per due volte nella direzione x.
Riempie un rettangolo sullo schermo usando il pennello di trama.
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
Si applica a
ScaleTransform(Single, Single, MatrixOrder)
- Origine:
- TextureBrush.cs
- Origine:
- TextureBrush.cs
- Origine:
- TextureBrush.cs
Scala la trasformazione geometrica locale di questo oggetto TextureBrush in base agli importi specificati nell'ordine indicato.
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)
Parametri
- sx
- Single
Importo in base al quale scalare la trasformazione nella direzione dell'asse X.
- sy
- Single
Importo in base al quale scalare la trasformazione nella direzione dell'asse Y.
- order
- MatrixOrder
Enumerazione MatrixOrder che specifica se accodare o anteporre la matrice di ridimensionamento.
Esempio
L'esempio seguente è progettato per l'uso con Windows Forms e richiede PaintEventArgse
, che è un parametro del Paint
gestore eventi. Il codice esegue le azioni seguenti:
Crea un oggetto TextureBrush.
Ridimensiona l'immagine della trama per due volte nella direzione x.
Riempie un rettangolo sullo schermo usando il pennello di trama.
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
Si applica a
Commenti e suggerimenti
https://aka.ms/ContentUserFeedback.
Presto disponibile: Nel corso del 2024 verranno gradualmente disattivati i problemi di GitHub come meccanismo di feedback per il contenuto e ciò verrà sostituito con un nuovo sistema di feedback. Per altre informazioni, vedereInvia e visualizza il feedback per