Represents a 3 x 3 affine transformation matrix used for transformations in two-dimensional space.
A Matrix provides the property value for the MatrixTransform.Matrix property. Often, it is more practical to manipulate the transforms by using one of the other transform objects and properties that constrain the transform into a particular type. The transform objects are RotateTransform, ScaleTransform, SkewTransform, and TranslateTransform.
The following example transforms the position and skew of a rectangle by using a MatrixTransform object.
<Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="400" Height="300"> <Rectangle Width="60" Height="60" Fill="Blue"> <Rectangle.RenderTransform> <MatrixTransform> <MatrixTransform.Matrix > <!-- This matrix transforms the x,y position of the rectangle and skews it. --> <Matrix OffsetX="30" OffsetY="100" M12="0.5" /> </MatrixTransform.Matrix> </MatrixTransform> </Rectangle.RenderTransform> </Rectangle> </Canvas>