TextureBrush.ScaleTransform Metoda

Definicja

Skaluje lokalną transformację geometryczną tego TextureBrush obiektu według określonych kwot. Ta metoda poprzedza macierz skalowania do przekształcenia.

Przeciążenia

ScaleTransform(Single, Single)

Skaluje lokalną transformację geometryczną tego TextureBrush obiektu według określonych kwot. Ta metoda poprzedza macierz skalowania do przekształcenia.

ScaleTransform(Single, Single, MatrixOrder)

Skaluje lokalną transformację geometryczną tego TextureBrush obiektu według określonych kwot w określonej kolejności.

ScaleTransform(Single, Single)

Źródło:
TextureBrush.cs
Źródło:
TextureBrush.cs
Źródło:
TextureBrush.cs

Skaluje lokalną transformację geometryczną tego TextureBrush obiektu według określonych kwot. Ta metoda poprzedza macierz skalowania do przekształcenia.

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)

Parametry

sx
Single

Ilość, o jaką należy skalować transformację w kierunku x.

sy
Single

Ilość, o jaką należy skalować transformację w kierunku y.

Przykłady

Poniższy przykład jest przeznaczony do użycia z Windows Forms i wymaga PaintEventArgseparametru Paint programu obsługi zdarzeń. Kod wykonuje następujące akcje:

  • Tworzy obiekt TextureBrush.

  • Skaluje obraz tekstury dwa razy w kierunku x.

  • Wypełnia prostokąt na ekranie za pomocą pędzla tekstury.

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

Dotyczy

ScaleTransform(Single, Single, MatrixOrder)

Źródło:
TextureBrush.cs
Źródło:
TextureBrush.cs
Źródło:
TextureBrush.cs

Skaluje lokalną transformację geometryczną tego TextureBrush obiektu według określonych kwot w określonej kolejności.

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)

Parametry

sx
Single

Ilość, o jaką należy skalować transformację w kierunku x.

sy
Single

Ilość, o jaką należy skalować transformację w kierunku y.

order
MatrixOrder

Wyliczenie MatrixOrder określające, czy ma być dołączana, czy poprzedzana macierz skalowania.

Przykłady

Poniższy przykład jest przeznaczony do użycia z Windows Forms i wymaga PaintEventArgseparametru Paint programu obsługi zdarzeń. Kod wykonuje następujące akcje:

  • Tworzy obiekt TextureBrush.

  • Skaluje obraz tekstury dwa razy w kierunku x.

  • Wypełnia prostokąt na ekranie za pomocą pędzla tekstury.

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

Dotyczy