MatrixTransform Object

Creates an arbitrary affine matrix transformation that is used to manipulate objects or coordinate systems in a 2-D plane.

<MatrixTransform .../>
To create an object using scripting, see CreateFromXAML.


Matrix, Name


Equals, FindName, GetHost, GetValue, SetValue


Use the MatrixTransform class to create custom transformations that are not provided by the RotateTransform, ScaleTransform, SkewTransform, and TranslateTransform classes.

A 3x3 matrix is used for transformations in a 2-D x-y plane. You can multiply affine matrix transformations to form linear transformations, such as rotation and skew (shear) that are followed by translation.

An affine matrix transformation has its final column equal to (0, 0, 1); therefore, you only have to specify the members in the first two columns.

The local 0,0 for an object can be offset on a Canvas using Canvas.Left and Canvas.Top, but this does not operate as a transform; the object retains its own local 0,0 in this case for transform purposes. For details on this concept, see Object Layout in Silverlight.

Multiple transforms can be applied with a TransformGroup.


The following example transforms the position and skew of a rectangle using a MatrixTransform.

  Width="400" Height="300">
  <Rectangle Width="60" Height="60" Fill="Blue">
        <MatrixTransform.Matrix >
          <!-- This matrix transforms the x,y position of
               the rectangle and skews it. -->
          <Matrix OffsetX="30" OffsetY="100" M12="0.5" />

See Also

Transform Overview