다음을 통해 공유


TextureBrush.TranslateTransform 메서드

정의

지정된 순서로 지정된 크기만큼 이 TextureBrush 개체의 로컬 기하학적 변형을 이동합니다.

오버로드

TranslateTransform(Single, Single)

TextureBrush 개체의 로컬 기하학적 변형을 지정된 크기만큼 이동합니다. 이 메서드는 이동을 변형 앞에 추가합니다.

TranslateTransform(Single, Single, MatrixOrder)

지정된 순서로 지정된 크기만큼 이 TextureBrush 개체의 로컬 기하학적 변형을 이동합니다.

TranslateTransform(Single, Single)

Source:
TextureBrush.cs
Source:
TextureBrush.cs
Source:
TextureBrush.cs

TextureBrush 개체의 로컬 기하학적 변형을 지정된 크기만큼 이동합니다. 이 메서드는 이동을 변형 앞에 추가합니다.

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)

매개 변수

dx
Single

x 방향으로 변형할 크기입니다.

dy
Single

y 방향으로 변형할 크기입니다.

예제

다음 예제는 Windows Forms 사용하도록 설계되었으며 이벤트 처리기의 Paint 매개 변수인 가 필요합니다.PaintEventArgse 코드는 다음 작업을 수행합니다.

  • TextureBrush 개체를 만듭니다.

  • x 방향에서 텍스처 이미지 50 단위를 변환합니다.

  • 텍스처 브러시를 사용하여 화면에 사각형을 채웁니다.

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

적용 대상

TranslateTransform(Single, Single, MatrixOrder)

Source:
TextureBrush.cs
Source:
TextureBrush.cs
Source:
TextureBrush.cs

지정된 순서로 지정된 크기만큼 이 TextureBrush 개체의 로컬 기하학적 변형을 이동합니다.

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)

매개 변수

dx
Single

x 방향으로 변형할 크기입니다.

dy
Single

y 방향으로 변형할 크기입니다.

order
MatrixOrder

이동을 적용할 순서(앞에 추가 또는 뒤에 추가)입니다.

예제

다음 예제는 Windows Forms 사용하도록 설계되었으며 이벤트 처리기의 Paint 매개 변수인 가 필요합니다.PaintEventArgse 코드는 다음 작업을 수행합니다.

  • TextureBrush 개체를 만듭니다.

  • x 방향에서 텍스처 이미지 50 단위를 변환합니다.

  • 텍스처 브러시를 사용하여 화면에 사각형을 채웁니다.

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

적용 대상