Matrix Structure
Represents a 3x3 affine transformation matrix used for transformations in 2-D space.
Assembly: WindowsBase (in WindowsBase.dll)
| Name | Description | |
|---|---|---|
![]() | Matrix(Double, Double, Double, Double, Double, Double) | Initializes a new instance of the Matrix structure. |
| Name | Description | |
|---|---|---|
![]() | Determinant | Gets the determinant of this Matrix structure. |
![]() | HasInverse | Gets a value that indicates whether this Matrix structure is invertible. |
![]() ![]() | Identity | Gets an identity Matrix. |
![]() | IsIdentity | Gets a value that indicates whether this Matrix structure is an identity matrix. |
![]() | M11 | Gets or sets the value of the first row and first column of this Matrix structure. |
![]() | M12 | Gets or sets the value of the first row and second column of this Matrix structure. |
![]() | M21 | Gets or sets the value of the second row and first column of this Matrix structure. |
![]() | M22 | Gets or sets the value of the second row and second column of this Matrix structure. |
![]() | OffsetX | Gets or sets the value of the third row and first column of this Matrix structure. |
![]() | OffsetY | Gets or sets the value of the third row and second column of this Matrix structure. |
| Name | Description | |
|---|---|---|
![]() | Append(Matrix) | Appends the specified Matrix structure to this Matrix structure. |
![]() | Equals(Matrix) | Determines whether the specified Matrix structure is identical to this instance. |
![]() ![]() | Equals(Matrix, Matrix) | Determines whether the two specified Matrix structures are identical. |
![]() | Equals(Object^) | Determines whether the specified Object is a Matrix structure that is identical to this Matrix. (Overrides ValueType::Equals(Object^).) |
![]() | GetHashCode() | Returns the hash code for this Matrix structure. (Overrides ValueType::GetHashCode().) |
![]() | GetType() | |
![]() | Invert() | Inverts this Matrix structure. |
![]() ![]() | Multiply(Matrix, Matrix) | Multiplies a Matrix structure by another Matrix structure. |
![]() ![]() | Parse(String^) | Converts a String representation of a matrix into the equivalent Matrix structure. |
![]() | Prepend(Matrix) | Prepends the specified Matrix structure onto this Matrix structure. |
![]() | Rotate(Double) | Applies a rotation of the specified angle about the origin of this Matrix structure. |
![]() | RotateAt(Double, Double, Double) | Rotates this matrix about the specified point. |
![]() | RotateAtPrepend(Double, Double, Double) | Prepends a rotation of the specified angle at the specified point to this Matrix structure. |
![]() | RotatePrepend(Double) | Prepends a rotation of the specified angle to this Matrix structure. |
![]() | Scale(Double, Double) | Appends the specified scale vector to this Matrix structure. |
![]() | ScaleAt(Double, Double, Double, Double) | Scales this Matrix by the specified amount about the specified point. |
![]() | ScaleAtPrepend(Double, Double, Double, Double) | Prepends the specified scale about the specified point of this Matrix. |
![]() | ScalePrepend(Double, Double) | Prepends the specified scale vector to this Matrix structure. |
![]() | SetIdentity() | Changes this Matrix structure into an identity matrix. |
![]() | Skew(Double, Double) | Appends a skew of the specified degrees in the x and y dimensions to this Matrix structure. |
![]() | SkewPrepend(Double, Double) | Prepends a skew of the specified degrees in the x and y dimensions to this Matrix structure. |
![]() | ToString() | Creates a String representation of this Matrix structure. (Overrides ValueType::ToString().) |
![]() | ToString(IFormatProvider^) | Creates a String representation of this Matrix structure with culture-specific formatting information. |
![]() | Transform(Point) | Transforms the specified point by the Matrix and returns the result. |
![]() | Transform(array<Point>^) | Transforms the specified points by this Matrix. |
![]() | Transform(Vector) | Transforms the specified vector by this Matrix. |
![]() | Transform(array<Vector>^) | Transforms the specified vectors by this Matrix. |
![]() | Translate(Double, Double) | Appends a translation of the specified offsets to this Matrix structure. |
![]() | TranslatePrepend(Double, Double) | Prepends a translation of the specified offsets to this Matrix structure. |
| Name | Description | |
|---|---|---|
![]() ![]() | Equality(Matrix, Matrix) | Determines whether the two specified Matrix structures are identical. |
![]() ![]() | Inequality(Matrix, Matrix) | Determines whether the two specified Matrix structures are not identical. |
![]() ![]() | Multiply(Matrix, Matrix) | Multiplies a Matrix structure by another Matrix structure. |
| Name | Description | |
|---|---|---|
![]() ![]() | IFormattable::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:
0 | ||
0 | ||
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
The value in the first row and first column of this Matrix. For more information, see the M11 property.
- m12
The value in the first row and second column. For more information, see the M12 property.
- m21
The value in the second row and first column. For more information, see the M21 property.
- m22
The value in the second row and second column. For more information, see the M22 property.
- offsetX
The value in the third row and third column. For more information, see the OffsetX property.
- offsetY
The value in the third row and second column. For more information, see the OffsetY property.
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.





