Matrix Struct
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents a 3x3 affine transformation matrix used for transformations in 2-D space.
public value class Matrix : IFormattable
[System.ComponentModel.TypeConverter(typeof(System.Windows.Media.MatrixConverter))]
[System.Serializable]
public struct Matrix : IFormattable
[System.ComponentModel.TypeConverter(typeof(System.Windows.Media.MatrixConverter))]
public struct Matrix : IFormattable
[<System.ComponentModel.TypeConverter(typeof(System.Windows.Media.MatrixConverter))>]
[<System.Serializable>]
type Matrix = struct
interface IFormattable
[<System.ComponentModel.TypeConverter(typeof(System.Windows.Media.MatrixConverter))>]
type Matrix = struct
interface IFormattable
Public Structure Matrix
Implements IFormattable
- Inheritance
- Attributes
- Implements
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:
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 first 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.
Matrix(Double, Double, Double, Double, Double, Double) |
Initializes a new instance of the Matrix structure. |
Determinant |
Gets the determinant of this Matrix structure. |
Has |
Gets a value that indicates whether this Matrix structure is invertible. |
Identity |
Gets an identity Matrix. |
Is |
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. |
Append(Matrix) |
Appends the specified Matrix structure to this Matrix structure. |
Equals(Matrix, Matrix) |
Determines whether the two specified Matrix structures are identical. |
Equals(Matrix) |
Determines whether the specified Matrix structure is identical to this instance. |
Equals(Object) |
Determines whether the specified Object is a Matrix structure that is identical to this Matrix. |
Get |
Returns the hash code for this Matrix structure. |
Invert() |
Inverts this Matrix structure. |
Multiply(Matrix, Matrix) | |
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. |
Rotate |
Rotates this matrix about the specified point. |
Rotate |
Prepends a rotation of the specified angle at the specified point to this Matrix structure. |
Rotate |
Prepends a rotation of the specified angle to this Matrix structure. |
Scale(Double, Double) |
Appends the specified scale vector to this Matrix structure. |
Scale |
Scales this Matrix by the specified amount about the specified point. |
Scale |
Prepends the specified scale about the specified point of this Matrix. |
Scale |
Prepends the specified scale vector to this Matrix structure. |
Set |
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. |
Skew |
Prepends a skew of the specified degrees in the x and y dimensions to this Matrix structure. |
To |
|
To |
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(Point[]) |
Transforms the specified points by this Matrix. |
Transform(Vector) |
Transforms the specified vector by this Matrix. |
Transform(Vector[]) |
Transforms the specified vectors by this Matrix. |
Translate(Double, Double) |
Appends a translation of the specified offsets to this Matrix structure. |
Translate |
Prepends a translation of the specified offsets to this Matrix structure. |
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) |
IFormattable. |
Formats the value of the current instance using the specified format. |
Produkt | Versioner |
---|---|
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |
Feedback om .NET
.NET är ett öppen källkod projekt. Välj en länk för att ge feedback: