Sdílet prostřednictvím


TextureBrush.ScaleTransform Metoda

Definice

Škáluje místní geometrické transformace tohoto TextureBrush objektu o zadané částky. Tato metoda předpenuje matici škálování na transformaci.

Přetížení

ScaleTransform(Single, Single)

Škáluje místní geometrické transformace tohoto TextureBrush objektu o zadané částky. Tato metoda předpenuje matici škálování na transformaci.

ScaleTransform(Single, Single, MatrixOrder)

Škáluje místní geometrické transformace tohoto TextureBrush objektu podle zadaných částek v zadaném pořadí.

ScaleTransform(Single, Single)

Zdroj:
TextureBrush.cs
Zdroj:
TextureBrush.cs
Zdroj:
TextureBrush.cs

Škáluje místní geometrické transformace tohoto TextureBrush objektu o zadané částky. Tato metoda předpenuje matici škálování na transformaci.

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

Množství, o které se má škálovat transformace ve směru x.

sy
Single

Množství, o které se má škálovat transformace ve směru y.

Příklady

Následující příklad je určený pro použití s model Windows Forms a vyžaduje PaintEventArgse, což je parametr obslužné rutiny Paint události. Kód provede následující akce:

  • TextureBrush Vytvoří objekt.

  • Škáluje obrázek textury dvakrát ve směru x.

  • Vyplní obdélník na obrazovce pomocí štětce textury.

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

Platí pro

ScaleTransform(Single, Single, MatrixOrder)

Zdroj:
TextureBrush.cs
Zdroj:
TextureBrush.cs
Zdroj:
TextureBrush.cs

Škáluje místní geometrické transformace tohoto TextureBrush objektu podle zadaných částek v zadaném pořadí.

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

Množství, o které se má škálovat transformace ve směru x.

sy
Single

Množství, o které se má škálovat transformace ve směru y.

order
MatrixOrder

Výčet MatrixOrder , který určuje, zda se má připojit nebo předvést matici škálování.

Příklady

Následující příklad je určený pro použití s model Windows Forms a vyžaduje PaintEventArgse, což je parametr obslužné rutiny Paint události. Kód provede následující akce:

  • TextureBrush Vytvoří objekt.

  • Škáluje obrázek textury dvakrát ve směru x.

  • Vyplní obdélník na obrazovce pomocí štětce textury.

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

Platí pro