Aracılığıyla paylaş


TextureBrush.TranslateTransform Yöntem

Tanım

Bu TextureBrush nesnenin yerel geometrik dönüşümlerini belirtilen sırada belirtilen boyutlara çevirir.

Aşırı Yüklemeler

TranslateTransform(Single, Single)

Bu TextureBrush nesnenin yerel geometrik dönüşümlerini belirtilen boyutlara çevirir. Bu yöntem, çeviriyi dönüştürmeye ekler.

TranslateTransform(Single, Single, MatrixOrder)

Bu TextureBrush nesnenin yerel geometrik dönüşümlerini belirtilen sırada belirtilen boyutlara çevirir.

TranslateTransform(Single, Single)

Kaynak:
TextureBrush.cs
Kaynak:
TextureBrush.cs
Kaynak:
TextureBrush.cs

Bu TextureBrush nesnenin yerel geometrik dönüşümlerini belirtilen boyutlara çevirir. Bu yöntem, çeviriyi dönüştürmeye ekler.

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)

Parametreler

dx
Single

Dönüştürmenin x yönünde çevrildiği boyut.

dy
Single

Dönüşümün y yönünde çevrildiği boyut.

Örnekler

Aşağıdaki örnek, Windows Forms ile kullanılmak üzere tasarlanmıştır ve olay işleyicisinin Paint bir parametresi olan gerektirir.PaintEventArgse Kod aşağıdaki eylemleri gerçekleştirir:

  • Bir TextureBrush nesnesi oluşturur.

  • Doku görüntüsünü x yönünde 50 birim çevirir.

  • Doku fırçasını kullanarak ekrandaki dikdörtgeni doldurur.

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

Şunlara uygulanır

TranslateTransform(Single, Single, MatrixOrder)

Kaynak:
TextureBrush.cs
Kaynak:
TextureBrush.cs
Kaynak:
TextureBrush.cs

Bu TextureBrush nesnenin yerel geometrik dönüşümlerini belirtilen sırada belirtilen boyutlara çevirir.

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)

Parametreler

dx
Single

Dönüştürmenin x yönünde çevrildiği boyut.

dy
Single

Dönüşümün y yönünde çevrildiği boyut.

order
MatrixOrder

Çevirinin uygulanacağı sıra (ek veya ek).

Örnekler

Aşağıdaki örnek, Windows Forms ile kullanılmak üzere tasarlanmıştır ve olay işleyicisinin Paint bir parametresi olan gerektirir.PaintEventArgse Kod aşağıdaki eylemleri gerçekleştirir:

  • Bir TextureBrush nesnesi oluşturur.

  • Doku görüntüsünü x yönünde 50 birim çevirir.

  • Doku fırçasını kullanarak ekrandaki dikdörtgeni doldurur.

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

Şunlara uygulanır