Creates an arbitrary affine matrix transformation that is used to manipulate objects or coordinate systems in a two-dimensional plane.
Assembly: System.Windows (in System.Windows.dll)
Thetype exposes the following members.
|CheckAccess||Determines whether the calling thread has access to this object. (Inherited from DependencyObject.)|
|ClearValue||Clears the local value of a dependency property. (Inherited from DependencyObject.)|
|Equals(Object)||Determines whether the specified Object is equal to the current Object. (Inherited from Object.)|
|Finalize||Allows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)|
|GetAnimationBaseValue||Returns any base value established for a Silverlight dependency property, which would apply in cases where an animation is not active. (Inherited from DependencyObject.)|
|GetHashCode||Serves as a hash function for a particular type. (Inherited from Object.)|
|GetType||Gets the Type of the current instance. (Inherited from Object.)|
|GetValue||Returns the current effective value of a dependency property from a DependencyObject. (Inherited from DependencyObject.)|
|MemberwiseClone||Creates a shallow copy of the current Object. (Inherited from Object.)|
|ReadLocalValue||Returns the local value of a dependency property, if a local value is set. (Inherited from DependencyObject.)|
|SetValue||Sets the local value of a dependency property on a DependencyObject. (Inherited from DependencyObject.)|
|ToString||Returns a string that represents the current object. (Inherited from Object.)|
|Transform||Transforms the specified point and returns the result. (Inherited from GeneralTransform.)|
|TransformBounds||Transforms the specified bounding box and returns an axis-aligned bounding box that is exactly large enough to contain it. (Inherited from Transform.)|
|TryTransform||Attempts to transform the specified point and returns a value that indicates whether the transformation was successful. (Inherited from Transform.)|
A two-dimensional x-y plane uses a 3 x 3 matrix for transformations. You can multiply affine matrix transformations to form linear transformations, such as rotation and skew (shear) transformations 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.
Methods and properties usually specify the transformation matrix as a vector that has only six members; the members are as follows:
You can offset the local (0,0) position for an object on a Canvas by using the Canvas.Left and Canvas.Top properties, but this does not operate as a transform; the object retains its own local (0,0) position in this case for transform purposes. For details on this concept, see Silverlight Layout System.
Multiple transforms can be applied with a TransformGroup.
The following example transforms the position and skew of a rectangle using a .
<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>
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.