# Matrix 结构

## 定义

``public value class Matrix : IFormattable``
``````[System.ComponentModel.TypeConverter(typeof(System.Windows.Media.MatrixConverter))]
public struct Matrix : IFormattable``````
``````[System.ComponentModel.TypeConverter(typeof(System.Windows.Media.MatrixConverter))]
[System.Serializable]
public struct Matrix : IFormattable``````
``````type Matrix = struct
interface IFormattable``````
``````Public Structure Matrix
Implements IFormattable``````

Matrix

## 注解

3x3 矩阵用于二维2-D x-y 平面中的变换。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. 仿射转换矩阵的最终列等于 (0, 0, 1), 因此只需指定前两列中的成员。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.

M11 M12 00
M21 M22 00
OffsetX OffsetY 11

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

### XAML 属性用法XAML Attribute Usage

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

### XAML 值XAML Values

m11m11
System.Double

Matrix中第一行、第一列中的值。The value in the first row and first column of this Matrix. 有关更多信息，请参见 M11 属性。For more information, see the M11 property.

m12m12
System.Double

m21m21
System.Double

m22m22
System.Double

offsetXoffsetX
System.Double

offsetYoffsetY
System.Double

## 构造函数

 初始化 Matrix 结构的新实例。Initializes a new instance of the Matrix structure.

## 属性

 获取此 Matrix 结构的行列式。Gets the determinant of this Matrix structure. 获取一个值，该值指示此 Matrix 结构是否可以反转。Gets a value that indicates whether this Matrix structure is invertible. 获取一个恒等 Matrix。Gets an identity Matrix. 获取一个值，该值指示此 Matrix 结构是否为恒等矩阵。Gets a value that indicates whether this Matrix structure is an identity matrix. 获取或设置此 Matrix 结构中第一行与第一列相交处的值。Gets or sets the value of the first row and first column of this Matrix structure. 获取或设置此 Matrix 结构中第一行与第二列相交处的值。Gets or sets the value of the first row and second column of this Matrix structure. 获取或设置此 Matrix 结构中第二行与第一列相交处的值。Gets or sets the value of the second row and first column of this Matrix structure. 获取或设置此 Matrix 结构中第二行与第二列相交处的值。Gets or sets the value of the second row and second column of this Matrix structure. 获取或设置此 Matrix 结构中第三行与第一列相交处的值。Gets or sets the value of the third row and first column of this Matrix structure. 获取或设置此 Matrix 结构中第三行与第二列相交处的值。Gets or sets the value of the third row and second column of this Matrix structure.

## 方法

 将指定的 Matrix 结构追加到此 Matrix 结构。Appends the specified Matrix structure to this Matrix structure. 确定指定的 Matrix 结构是否与此实例相同。Determines whether the specified Matrix structure is identical to this instance. 确定两个指定的 Matrix 结构是否相同。Determines whether the two specified Matrix structures are identical. 确定指定的 Object 是否是一个与此 Matrix 相同的 Matrix 结构。Determines whether the specified Object is a Matrix structure that is identical to this Matrix. 返回此 Matrix 结构的哈希代码。Returns the hash code for this Matrix structure. 反转此 Matrix 结构。Inverts this Matrix structure. 让 Matrix 结构乘以另一个 Matrix 结构。Multiplies a Matrix structure by another Matrix structure. 将矩阵的 String 表示形式转换为等效的 Matrix 结构。Converts a String representation of a matrix into the equivalent Matrix structure. 将指定的 Matrix 结构添加到此 Matrix 结构之前。Prepends the specified Matrix structure onto this Matrix structure. 以此 Matrix 结构的原点为中心旋转指定的角度。Applies a rotation of the specified angle about the origin of this Matrix structure. 绕指定的点旋转此矩阵。Rotates this matrix about the specified point. 在此 Matrix 结构前面添加围绕指定点的指定角度的旋转。Prepends a rotation of the specified angle at the specified point to this Matrix structure. 在此 Matrix 结构前面添加指定角度的旋转。Prepends a rotation of the specified angle to this Matrix structure. 在此 Matrix 结构后面追加指定的缩放向量。Appends the specified scale vector to this Matrix structure. 围绕指定的点按指定的量缩放此 Matrix。Scales this Matrix by the specified amount about the specified point. 在此 Matrix 前面添加围绕指定点的指定缩放。Prepends the specified scale about the specified point of this Matrix. 在此 Matrix 结构前面添加指定的缩放向量。Prepends the specified scale vector to this Matrix structure. 将此 Matrix 结构更改为恒等矩阵。Changes this Matrix structure into an identity matrix. 在此 Matrix 结构后面追加 x 和 y 维中指定角度的扭曲。Appends a skew of the specified degrees in the x and y dimensions to this Matrix structure. 在此 Matrix 结构前面添加 x 和 y 维中指定角度的扭曲。Prepends a skew of the specified degrees in the x and y dimensions to this Matrix structure. 创建此 String 结构的 Matrix 表示形式。Creates a String representation of this Matrix structure. 使用区域性特定的格式设置信息创建此 String 结构的 Matrix 表示形式。Creates a String representation of this Matrix structure with culture-specific formatting information. 用 Matrix 变换指定的点并返回结果。Transforms the specified point by the Matrix and returns the result. 用此 Matrix 变换指定的点。Transforms the specified points by this Matrix. 用此 Matrix 变换指定的向量。Transforms the specified vector by this Matrix. 用此 Matrix 变换指定的向量。Transforms the specified vectors by this Matrix. 在此 Matrix 结构后面追加指定偏移量的平移。Appends a translation of the specified offsets to this Matrix structure. 在此 Matrix 结构前面添加指定偏移量的平移。Prepends a translation of the specified offsets to this Matrix structure.

## 运算符

 确定两个指定的 Matrix 结构是否相同。Determines whether the two specified Matrix structures are identical. 确定两个指定的 Matrix 结构是否不同。Determines whether the two specified Matrix structures are not identical. 让 Matrix 结构乘以另一个 Matrix 结构。Multiplies a Matrix structure by another Matrix structure.

## 显式接口实现

 使用指定的格式格式化当前实例的值。Formats the value of the current instance using the specified format.