Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Rect.Transform Method (Rect, Matrix)

Returns the rectangle that results from applying the specified matrix to the specified rectangle.

Namespace:  System.Windows
Assembly:  WindowsBase (in WindowsBase.dll)

public static Rect Transform(
	Rect rect,
	Matrix matrix
)

Parameters

rect
Type: System.Windows.Rect

A rectangle that is the basis for the transformation.

matrix
Type: System.Windows.Media.Matrix

A matrix that specifies the transformation to apply.

Return Value

Type: System.Windows.Rect
The rectangle that results from the operation.

The following example shows how to use the Transform(Rect, Matrix) method to create a new Rect structure that results from applying a Matrix to an existing rectangle.

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;

}

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft