Matrix.Identity 屬性

定義

取得單位 Matrix

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

屬性值

單位矩陣。

範例

下列範例示範如何擷 Identity 取矩陣。

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],[2,2],[3,3,3] 中具有 1 的值,而其餘係數中的值為 0。 這與設定 M11M22 與 1 和 M12 、、 M21OffsetXOffsetY 相互關聯至 0。 在 affine 矩陣中,這是Windows Presentation Foundation (WPF) 用於 Matrix 、結構、係數 [3,1]、[3,2]、[3.3] 的實作隱含為一律具有 0,0,1 的值。

1 0 0
0 1 0
0 0 1

針對識別矩陣,方法會 ToString 傳回字串 「Identity」,而不是 的 Matrix 係數。

適用於

另請參閱