Skip to main content
.NET Framework Class Library
MatrixTransform Class

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

Namespace:   System.Windows.Media
Assembly:  PresentationCore (in PresentationCore.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
Syntax
Public NotInheritable Class MatrixTransform _
	Inherits [%$TOPIC/ms635220_en-us_VS_110_2_0_0_0_0%]
public sealed class MatrixTransform : [%$TOPIC/ms635220_en-us_VS_110_2_0_1_0_0%]
public ref class MatrixTransform sealed : public [%$TOPIC/ms635220_en-us_VS_110_2_0_2_0_0%]
[<[%$TOPIC/ms635220_en-us_VS_110_2_0_3_0_0%]>]
type MatrixTransform =  
    class 
        inherit [%$TOPIC/ms635220_en-us_VS_110_2_0_3_0_1%] 
    end
public final class MatrixTransform extends [%$TOPIC/ms635220_en-us_VS_110_2_0_4_0_0%]
<MatrixTransform .../>
<object property="m11, m12, m21, m22, offsetX, offsetY"/>
- or -
<object property="Identity"/>

XAML Values

m11

SystemDouble

The value at position (1, 1) of the transformation Matrix.

m12

SystemDouble

The value at position (1, 2) of the transformation Matrix.

m21

SystemDouble

The value at position (2, 1) of the transformation Matrix.

m22

SystemDouble

The value at position (2, 2) of the transformation Matrix.

offsetX

SystemDouble

The value at position (3, 1) of the transformation Matrix.

offsetY

SystemDouble

The value at position (3, 2) of the transformation Matrix.

The MatrixTransform type exposes the following members.

Constructors
  NameDescription
Public method MatrixTransformInitializes a new instance of the MatrixTransform class.
Public method MatrixTransform(Matrix)Initializes a new instance of the MatrixTransform class with the specified transformation matrix.
Public method MatrixTransform(Double, Double, Double, Double, Double, Double)Initializes a new instance of the MatrixTransform class with the specified transformation matrix values.
Top
Properties
  NameDescription
Public property CanFreezeGets a value that indicates whether the object can be made unmodifiable. (Inherited from Freezable.)
Public property DependencyObjectTypeGets the DependencyObjectType that wraps the CLR type of this instance.  (Inherited from DependencyObject.)
Public property DispatcherGets the Dispatcher this DispatcherObject is associated with. (Inherited from DispatcherObject.)
Public property HasAnimatedPropertiesGets a value that indicates whether one or more AnimationClock objects is associated with any of this object's dependency properties. (Inherited from Animatable.)
Public property InverseGets the inverse of this transform, if it exists. (Inherited from Transform.)
Public property IsFrozenGets a value that indicates whether the object is currently modifiable. (Inherited from Freezable.)
Public property IsSealedGets a value that indicates whether this instance is currently sealed (read-only). (Inherited from DependencyObject.)
Public property MatrixGets or sets the Matrix structure that defines this transformation.
Public property ValueGets the Matrix that represents this MatrixTransform. (Overrides TransformValue.)
Top
Methods
  NameDescription
Public method ApplyAnimationClock(DependencyProperty, AnimationClock)Applies an AnimationClock to the specified DependencyProperty. If the property is already animated, the SnapshotAndReplace handoff behavior is used. (Inherited from Animatable.)
Public method ApplyAnimationClock(DependencyProperty, AnimationClock, HandoffBehavior)Applies an AnimationClock to the specified DependencyProperty. If the property is already animated, the specified HandoffBehavior is used. (Inherited from Animatable.)
Public method BeginAnimation(DependencyProperty, AnimationTimeline)Applies an animation to the specified DependencyProperty. The animation is started when the next frame is rendered. If the specified property is already animated, the SnapshotAndReplace handoff behavior is used. (Inherited from Animatable.)
Public method BeginAnimation(DependencyProperty, AnimationTimeline, HandoffBehavior)Applies an animation to the specified DependencyProperty. The animation is started when the next frame is rendered. If the specified property is already animated, the specified HandoffBehavior is used. (Inherited from Animatable.)
Public method CheckAccessDetermines whether the calling thread has access to this DispatcherObject. (Inherited from DispatcherObject.)
Public method ClearValue(DependencyProperty)Clears the local value of a property. The property to be cleared is specified by a DependencyProperty identifier. (Inherited from DependencyObject.)
Public method ClearValue(DependencyPropertyKey)Clears the local value of a read-only property. The property to be cleared is specified by a DependencyPropertyKey. (Inherited from DependencyObject.)
Public method CloneCreates a modifiable copy of this MatrixTransform by making deep copies of its values.
Public method CloneCurrentValueCreates a modifiable copy of this MatrixTransform object by making deep copies of its values. This method does not copy resource references, data bindings, or animations, although it does copy their current values.
Public method CoerceValueCoerces the value of the specified dependency property. This is accomplished by invoking any CoerceValueCallback function specified in property metadata for the dependency property as it exists on the calling DependencyObject. (Inherited from DependencyObject.)
Public method EqualsDetermines whether a provided DependencyObject is equivalent to the current DependencyObject. (Inherited from DependencyObject.)
Public method FreezeMakes the current object unmodifiable and sets its IsFrozen property to true. (Inherited from Freezable.)
Public method GetAnimationBaseValueReturns the non-animated value of the specified DependencyProperty. (Inherited from Animatable.)
Public method GetAsFrozenCreates a frozen copy of the Freezable, using base (non-animated) property values. Because the copy is frozen, any frozen sub-objects are copied by reference. (Inherited from Freezable.)
Public method GetCurrentValueAsFrozenCreates a frozen copy of the Freezable using current property values. Because the copy is frozen, any frozen sub-objects are copied by reference. (Inherited from Freezable.)
Public method GetHashCodeGets a hash code for this DependencyObject. (Inherited from DependencyObject.)
Public method GetLocalValueEnumeratorCreates a specialized enumerator for determining which dependency properties have locally set values on this DependencyObject. (Inherited from DependencyObject.)
Public method GetTypeGets the Type of the current instance. (Inherited from Object.)
Public method GetValueReturns the current effective value of a dependency property on this instance of a DependencyObject. (Inherited from DependencyObject.)
Public method InvalidatePropertyRe-evaluates the effective value for the specified dependency property (Inherited from DependencyObject.)
Public method ReadLocalValueReturns the local value of a dependency property, if it exists. (Inherited from DependencyObject.)
Public method SetCurrentValueSets the value of a dependency property without changing its value source. (Inherited from DependencyObject.)
Public method SetValue(DependencyProperty, Object)Sets the local value of a dependency property, specified by its dependency property identifier. (Inherited from DependencyObject.)
Public method SetValue(DependencyPropertyKey, Object)Sets the local value of a read-only dependency property, specified by the DependencyPropertyKey identifier of the dependency property. (Inherited from DependencyObject.)
Protected method ShouldSerializePropertyReturns a value that indicates whether serialization processes should serialize the value for the provided dependency property. (Inherited from DependencyObject.)
Public method ToStringCreates a string representation of this GeneralTransform. (Inherited from GeneralTransform.)
Public method ToString(IFormatProvider)Creates a string representation of this instance, based on the passed IFormatProvider parameter. (Inherited from GeneralTransform.)
Public method TransformTransforms the specified point and returns the result. (Inherited from GeneralTransform.)
Public method TransformBoundsTransforms the specified bounding box and returns an axis-aligned bounding box that is exactly large enough to contain it. (Inherited from Transform.)
Public method TryTransformAttempts to transform the specified point and returns a value that indicates whether the transformation was successful. (Inherited from Transform.)
Public method VerifyAccessEnforces that the calling thread has access to this DispatcherObject. (Inherited from DispatcherObject.)
Top
Events
  NameDescription
Public event ChangedOccurs when the Freezable or an object it contains is modified. (Inherited from Freezable.)
Top
Fields
  NameDescription
Public field Static member MatrixPropertyIdentifies the Matrix dependency property.
Top
Explicit Interface Implementations
  NameDescription
Explicit interface implemetation Private method IFormattableToStringFormats the value of the current instance using the specified format. (Inherited from GeneralTransform.)
Top
Remarks

Use the MatrixTransform class to create custom transformations that are not provided by the RotateTransform, SkewTransform, ScaleTransform, or 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.

A Windows Presentation Foundation (WPF)  Matrix has the following structure:

The members in the last row, OffsetX and OffsetY, represent translation values.

Methods and properties usually specify the transformation matrix as a vector that has only six members; the members are as follows:

    ( M11, M12, M21, M22, OffsetX, OffsetY)

Version Information

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.