Matrix.Identity 屬性

定義

取得單位 MatrixGets an identity Matrix.

public:
 static property System::Windows::Media::Matrix Identity { System::Windows::Media::Matrix get(); };
public static System.Windows.Media.Matrix Identity { get; }
member this.Identity : System.Windows.Media.Matrix
Public Shared ReadOnly Property Identity As Matrix

屬性值

單位矩陣。An identity matrix.

範例

下列範例顯示如何Identity抓取矩陣。The following example shows how to retrieve the Identity matrix.

private Matrix identityExample()
{

    // Get the identity matrix, which is equal to 
    // (1,0,0,1,0,0). 
    Matrix myMatrix = Matrix.Identity;


    Matrix m = new Matrix(1,0,0,1,0,0);

    return myMatrix;
    
       
}

備註

識別矩陣的值為 1, 係數為 [1, 1], [2, 2], [3, 3], 而在其餘係數中的值為0。An identity matrix has a value of 1 in coefficients [1,1],[2,2],[3,3] and a value of 0 in the rest of the coefficients. 這會與將M11M22設定M21 M12 OffsetY為1、、、和設為0的相互關聯。 OffsetXThis correlates to setting M11 and M22 to 1 and M12, M21, OffsetX, and OffsetY to 0. 在「仿射矩陣」中, 這是Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) Matrix針對、結構、係數 [3, 1]、[3、2]、[3.3] 所使用的實值, 其一律分別為 0, 0, 1。In an affine matrix, which is the implementation that Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) uses for the Matrix, structure, coefficients [3,1],[3,2],[3.3] are implied to always have the values 0,0,1 respectively.

11 00 00
00 11 00
00 00 11

對於識別矩陣, ToString方法會傳回字串 "identity", 而不是傳回的係數。 MatrixFor an identity matrix, the ToString method returns the string "Identity" instead of the coefficients of the Matrix.

適用於

另請參閱