TextureBrush.TranslateTransform Metoda

Definice

Přeloží místní geometrické transformace tohoto TextureBrush objektu podle zadaných dimenzí v zadaném pořadí.

Přetížení

TranslateTransform(Single, Single)

Přeloží místní geometrické transformace tohoto TextureBrush objektu podle zadaných rozměrů. Tato metoda předpenduje překlad transformace.

TranslateTransform(Single, Single, MatrixOrder)

Přeloží místní geometrické transformace tohoto TextureBrush objektu podle zadaných dimenzí v zadaném pořadí.

TranslateTransform(Single, Single)

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

Přeloží místní geometrické transformace tohoto TextureBrush objektu podle zadaných rozměrů. Tato metoda předpenduje překlad transformace.

public:
 void TranslateTransform(float dx, float dy);
public void TranslateTransform (float dx, float dy);
member this.TranslateTransform : single * single -> unit
Public Sub TranslateTransform (dx As Single, dy As Single)

Parametry

dx
Single

Dimenze, podle které se má transformace přeložit ve směru x.

dy
Single

Dimenze, podle které se má transformace převést ve směru y.

Příklady

Následující příklad je navrž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:

  • Vytvoří TextureBrush objekt.

  • Přeloží 50 jednotek textury ve směru x.

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

void TranslateTransform_Example1( PaintEventArgs^ e )
{
   // Create a TextureBrush object.
   TextureBrush^ tBrush = gcnew TextureBrush( gcnew Bitmap( "texture.jpg" ) );

   // Move the texture image 2X in the x-direction.
   tBrush->TranslateTransform( 50, 0, MatrixOrder::Prepend );

   // Fill a rectangle with tBrush.
   e->Graphics->FillRectangle( tBrush, 0, 0, 100, 100 );
}
public void TranslateTransform_Example1(PaintEventArgs e)
{
             
    // Create a TextureBrush object.
    TextureBrush tBrush = new TextureBrush(new Bitmap("texture.jpg"));
             
    // Move the texture image 2X in the x-direction.
    tBrush.TranslateTransform(50, 0, MatrixOrder.Prepend);
             
    // Fill a rectangle with tBrush.
    e.Graphics.FillRectangle(tBrush, 0, 0, 100, 100);
}
Public Sub TranslateTransform_Example1(ByVal e As PaintEventArgs)

    ' Create a TextureBrush object.
    Dim tBrush As New TextureBrush(New Bitmap("texture.jpg"))

    ' Move the texture image 2X in the x-direction.
    tBrush.TranslateTransform(50, 0, MatrixOrder.Prepend)

    ' Fill a rectangle with tBrush.
    e.Graphics.FillRectangle(tBrush, 0, 0, 100, 100)
End Sub

Platí pro

TranslateTransform(Single, Single, MatrixOrder)

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

Přeloží místní geometrické transformace tohoto TextureBrush objektu podle zadaných dimenzí v zadaném pořadí.

public:
 void TranslateTransform(float dx, float dy, System::Drawing::Drawing2D::MatrixOrder order);
public void TranslateTransform (float dx, float dy, System.Drawing.Drawing2D.MatrixOrder order);
member this.TranslateTransform : single * single * System.Drawing.Drawing2D.MatrixOrder -> unit
Public Sub TranslateTransform (dx As Single, dy As Single, order As MatrixOrder)

Parametry

dx
Single

Dimenze, podle které se má transformace přeložit ve směru x.

dy
Single

Dimenze, podle které se má transformace převést ve směru y.

order
MatrixOrder

Pořadí (předpřidání nebo připojení), ve kterém se má překlad použít.

Příklady

Následující příklad je navrž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:

  • Vytvoří TextureBrush objekt.

  • Přeloží 50 jednotek textury ve směru x.

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

void TranslateTransform_Example2( PaintEventArgs^ e )
{
   // Create a TextureBrush object.
   TextureBrush^ tBrush = gcnew TextureBrush( gcnew Bitmap( "texture.jpg" ) );

   // Move the texture image 2X in the x-direction.
   tBrush->TranslateTransform( 50, 0 );

   // Fill a rectangle with tBrush.
   e->Graphics->FillRectangle( tBrush, 0, 0, 100, 100 );
}
public void TranslateTransform_Example2(PaintEventArgs e)
{
         
    // Create a TextureBrush object.
    TextureBrush tBrush = new TextureBrush(new Bitmap("texture.jpg"));
         
    // Move the texture image 2X in the x-direction.
    tBrush.TranslateTransform(50, 0);
         
    // Fill a rectangle with tBrush.
    e.Graphics.FillRectangle(tBrush, 0, 0, 100, 100);
}
Public Sub TranslateTransform_Example2(ByVal e As PaintEventArgs)

    ' Create a TextureBrush object.
    Dim tBrush As New TextureBrush(New Bitmap("texture.jpg"))

    ' Move the texture image 2X in the x-direction.
    tBrush.TranslateTransform(50, 0)

    ' Fill a rectangle with tBrush.
    e.Graphics.FillRectangle(tBrush, 0, 0, 100, 100)
End Sub

Platí pro