Rect.Transform 메서드

정의

지정된 매트릭스를 사용하여 사각형을 변환합니다.

오버로드

Transform(Matrix)

지정된 매트릭스를 적용하여 사각형을 변환합니다.

Transform(Rect, Matrix)

지정된 사각형에 지정된 매트릭스를 적용하여 만들어진 사각형을 반환합니다.

Transform(Matrix)

지정된 매트릭스를 적용하여 사각형을 변환합니다.

public:
 void Transform(System::Windows::Media::Matrix matrix);
public void Transform (System.Windows.Media.Matrix matrix);
member this.Transform : System.Windows.Media.Matrix -> unit
Public Sub Transform (matrix As Matrix)

매개 변수

matrix
Matrix

적용할 변환을 지정하는 매트릭스입니다.

예제

다음 예제에서는 사용 하는 방법을 보여 줍니다는 Transform(Matrix) 변환 하는 메서드를 Rect 구조를 사용 하 여를 Matrix입니다.

private Rect transformExample1()
{
    // Initialize new rectangle.
    Rect myRectangle = new Rect();

    // Set the Size property of the rectangle with a width of 200
    // and a height of 60.
    myRectangle.Size = new Size(200, 60);

    // Creating a Matrix structure.
    Matrix myMatrix = new Matrix(0, 1, 1, 0, 20, 2);

    // The Transform method transforms this rectangle using the specified matrix.  
    // myRectangle location changed from 0,0 to 20, 2 and the size changed from
    // 200,60 to 60,200.
    myRectangle.Transform(myMatrix);

    return myRectangle;
}

적용 대상

Transform(Rect, Matrix)

지정된 사각형에 지정된 매트릭스를 적용하여 만들어진 사각형을 반환합니다.

public:
 static System::Windows::Rect Transform(System::Windows::Rect rect, System::Windows::Media::Matrix matrix);
public static System.Windows.Rect Transform (System.Windows.Rect rect, System.Windows.Media.Matrix matrix);
static member Transform : System.Windows.Rect * System.Windows.Media.Matrix -> System.Windows.Rect
Public Shared Function Transform (rect As Rect, matrix As Matrix) As Rect

매개 변수

rect
Rect

변환의 기준이 되는 사각형입니다.

matrix
Matrix

적용할 변환을 지정하는 매트릭스입니다.

반환

Rect

작업 결과로 만들어지는 사각형입니다.

예제

다음 예제에서는 사용 하는 방법을 보여 줍니다 합니다 Transform(Rect, Matrix) 메서드를 새 Rect 구조를 적용 하는 Matrix 기존 사각형에.

private Rect transformExample2()
{
    // Initialize new rectangle.
    Rect myRectangle = new Rect();

    // Set the Size property of the rectangle with a width of 200
    // and a height of 60.
    myRectangle.Size = new Size(200, 60);

    // Creating a Matrix structure.
    Matrix myMatrix = new Matrix(0, 1, 1, 0, 20, 2);

    // The Transform method Transforms the specified rectangle using the specified matrix 
    // and returns the results.  
    // resultRect is an alterned version of myRectangle with a location of 20,2 rather
    // then 0,0 and a size of 60,200 rather then 200,60.
    Rect resultRect = Rect.Transform(myRectangle,myMatrix);

    return resultRect;
}

적용 대상