MatrixTransform class

Applies to Windows and Windows Phone

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

Inheritance

Object
  DependencyObject
    GeneralTransform
      Transform
        MatrixTransform

Syntax


public sealed class MatrixTransform : Transform


<MatrixTransform .../>


<object property="m11, m12, m21, m22, offsetX, offsetY"/>
- or -
<object property="Identity"/>

XAML Values

m11

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

m12

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

m21

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

m22

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

offsetX

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

offsetY

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

Attributes

[MarshalingBehavior(Agile)]
[Threading(Both)]
[Version(0x06020000)]
[WebHostHidden()]

Members

The MatrixTransform class has these types of members:

Constructors

The MatrixTransform class has these constructors.

ConstructorDescription
MatrixTransform Initializes a new instance of the MatrixTransform class.

 

Methods

The MatrixTransform class has these methods. It also inherits methods from the Object class.

MethodDescription
ClearValue Clears the local value of a dependency property. (Inherited from DependencyObject)
GetAnimationBaseValue Returns any base value established for a dependency property, which would apply in cases where an animation is not active. (Inherited from DependencyObject)
GetValue Returns the current effective value of a dependency property from a DependencyObject. (Inherited from DependencyObject)
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)
TransformBounds Transforms the specified bounding box and returns an axis-aligned bounding box that is exactly large enough to contain it. (Inherited from GeneralTransform)
TransformBoundsCore Provides the means to override the TransformBounds behavior in a derived transform class. (Inherited from GeneralTransform)
TransformPoint Uses this transformation object's logic to transform the specified point, and returns the result. (Inherited from GeneralTransform)
TryTransform Attempts to transform the specified point and returns a value that indicates whether the transformation was successful. (Inherited from GeneralTransform)
TryTransformCore Provides the means to override the TryTransform behavior in a derived transform class. (Inherited from GeneralTransform)

 

Properties

The MatrixTransform class has these properties.

PropertyAccess typeDescription

Dispatcher

Read-onlyGets the CoreDispatcher that this object is associated with. (Inherited from DependencyObject)

Inverse

Read-onlyGets the inverse transformation of this GeneralTransform, if possible. (Inherited from GeneralTransform)

InverseCore

Read-onlyImplements the behavior for return value of Inverse in a derived or custom GeneralTransform. (Inherited from GeneralTransform)

Matrix

Read/writeGets or sets the Matrix that defines this transformation.

MatrixProperty

Read-onlyIdentifies the Matrix dependency property.

 

Examples

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


<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>


Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Media
Windows::UI::Xaml::Media [C++]

Metadata

Windows.winmd

See also

Transform

 

 

Show:
© 2014 Microsoft