Matrix Structure
TOC
Collapse the table of content
Expand the table of content

Matrix Structure

 

Represents a 3x3 affine transformation matrix used for transformations in 2-D space.

Namespace:   System.Windows.Media
Assembly:  WindowsBase (in WindowsBase.dll)

[SerializableAttribute]
[TypeConverterAttribute(typeof(MatrixConverter))]
public struct Matrix : IFormattable

NameDescription
System_CAPS_pubmethodMatrix(Double, Double, Double, Double, Double, Double)

Initializes a new instance of the Matrix structure.

NameDescription
System_CAPS_pubpropertyDeterminant

Gets the determinant of this Matrix structure.

System_CAPS_pubpropertyHasInverse

Gets a value that indicates whether this Matrix structure is invertible.

System_CAPS_pubpropertySystem_CAPS_staticIdentity

Gets an identity Matrix.

System_CAPS_pubpropertyIsIdentity

Gets a value that indicates whether this Matrix structure is an identity matrix.

System_CAPS_pubpropertyM11

Gets or sets the value of the first row and first column of this Matrix structure.

System_CAPS_pubpropertyM12

Gets or sets the value of the first row and second column of this Matrix structure.

System_CAPS_pubpropertyM21

Gets or sets the value of the second row and first column of this Matrix structure.

System_CAPS_pubpropertyM22

Gets or sets the value of the second row and second column of this Matrix structure.

System_CAPS_pubpropertyOffsetX

Gets or sets the value of the third row and first column of this Matrix structure.

System_CAPS_pubpropertyOffsetY

Gets or sets the value of the third row and second column of this Matrix structure.

NameDescription
System_CAPS_pubmethodAppend(Matrix)

Appends the specified Matrix structure to this Matrix structure.

System_CAPS_pubmethodEquals(Matrix)

Determines whether the specified Matrix structure is identical to this instance.

System_CAPS_pubmethodSystem_CAPS_staticEquals(Matrix, Matrix)

Determines whether the two specified Matrix structures are identical.

System_CAPS_pubmethodEquals(Object)

Determines whether the specified Object is a Matrix structure that is identical to this Matrix. (Overrides ValueType.Equals(Object).)

System_CAPS_pubmethodGetHashCode()

Returns the hash code for this Matrix structure. (Overrides ValueType.GetHashCode().)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodInvert()

Inverts this Matrix structure.

System_CAPS_pubmethodSystem_CAPS_staticMultiply(Matrix, Matrix)

Multiplies a Matrix structure by another Matrix structure.

System_CAPS_pubmethodSystem_CAPS_staticParse(String)

Converts a String representation of a matrix into the equivalent Matrix structure.

System_CAPS_pubmethodPrepend(Matrix)

Prepends the specified Matrix structure onto this Matrix structure.

System_CAPS_pubmethodRotate(Double)

Applies a rotation of the specified angle about the origin of this Matrix structure.

System_CAPS_pubmethodRotateAt(Double, Double, Double)

Rotates this matrix about the specified point.

System_CAPS_pubmethodRotateAtPrepend(Double, Double, Double)

Prepends a rotation of the specified angle at the specified point to this Matrix structure.

System_CAPS_pubmethodRotatePrepend(Double)

Prepends a rotation of the specified angle to this Matrix structure.

System_CAPS_pubmethodScale(Double, Double)

Appends the specified scale vector to this Matrix structure.

System_CAPS_pubmethodScaleAt(Double, Double, Double, Double)

Scales this Matrix by the specified amount about the specified point.

System_CAPS_pubmethodScaleAtPrepend(Double, Double, Double, Double)

Prepends the specified scale about the specified point of this Matrix.

System_CAPS_pubmethodScalePrepend(Double, Double)

Prepends the specified scale vector to this Matrix structure.

System_CAPS_pubmethodSetIdentity()

Changes this Matrix structure into an identity matrix.

System_CAPS_pubmethodSkew(Double, Double)

Appends a skew of the specified degrees in the x and y dimensions to this Matrix structure.

System_CAPS_pubmethodSkewPrepend(Double, Double)

Prepends a skew of the specified degrees in the x and y dimensions to this Matrix structure.

System_CAPS_pubmethodToString()

Creates a String representation of this Matrix structure. (Overrides ValueType.ToString().)

System_CAPS_pubmethodToString(IFormatProvider)

Creates a String representation of this Matrix structure with culture-specific formatting information.

System_CAPS_pubmethodTransform(Point)

Transforms the specified point by the Matrix and returns the result.

System_CAPS_pubmethodTransform(Point[])

Transforms the specified points by this Matrix.

System_CAPS_pubmethodTransform(Vector)

Transforms the specified vector by this Matrix.

System_CAPS_pubmethodTransform(Vector[])

Transforms the specified vectors by this Matrix.

System_CAPS_pubmethodTranslate(Double, Double)

Appends a translation of the specified offsets to this Matrix structure.

System_CAPS_pubmethodTranslatePrepend(Double, Double)

Prepends a translation of the specified offsets to this Matrix structure.

NameDescription
System_CAPS_puboperatorSystem_CAPS_staticEquality(Matrix, Matrix)

Determines whether the two specified Matrix structures are identical.

System_CAPS_puboperatorSystem_CAPS_staticInequality(Matrix, Matrix)

Determines whether the two specified Matrix structures are not identical.

System_CAPS_puboperatorSystem_CAPS_staticMultiply(Matrix, Matrix)

Multiplies a Matrix structure by another Matrix structure.

NameDescription
System_CAPS_pubinterfaceSystem_CAPS_privmethodIFormattable.ToString(String, IFormatProvider)

Formats the value of the current instance using the specified format.

A 3x3 matrix is used for transformations in a 2-D x-y plane. Affine transformation matrices can be multiplied to form any number of linear transformations, such as rotation and skew (shear), followed by translation. An affine transformation matrix has its final column equal to (0, 0, 1), so only the members in the first two columns need to be specified.  Note that vectors are expressed as row-vectors, not column vectors. 

A WPF Matrix is stored using row-major order and has the following structure:

M11

M12

0

M21

M22

0

OffsetX

OffsetY

1

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

In methods and properties, the transformation matrix is usually specified as a vector with only six members, as follows:

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

Although you can use a Matrix structure directly to translate individual points, or with a MatrixTransform to transform objects, WPF also provides a set of classes that enable you to transform objects without working directly with matrices: RotateTransform, ScaleTransform, SkewTransform, and TranslateTransform.

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

m11

System.Double

The value in the first row and first column of this Matrix. For more information, see the M11 property.

m12

System.Double

The value in the first row and second column. For more information, see the M12 property.

m21

System.Double

The value in the second row and first column. For more information, see the M21 property.

m22

System.Double

The value in the second row and second column. For more information, see the M22 property.

offsetX

System.Double

The value in the third row and third column. For more information, see the OffsetX property.

offsetY

System.Double

The value in the third row and second column. For more information, see the OffsetY property.

.NET Framework
Available since 3.0
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2016 Microsoft