Matrix.Identity 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
獲得一個身份 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] 中值為 1,其他係數為 0。 這與設定 M11 和 M22 對應於 1 和 M12、 M21、 OffsetX、 OffsetY 與 0。 在仿射矩陣中,這是 Windows Presentation Foundation (WPF) 用於 Matrix 結構的實作,係數 [3,1]、[3,2]、[3.3],分別隱含為 0,0,1。
| 欄 1 | 第2欄 | 欄位 3 |
|---|---|---|
| 1 | 0 | 0 |
| 0 | 1 | 0 |
| 0 | 0 | 1 |
對於單位矩陣, ToString 該方法回傳的是字串「Identity」,而非 的 Matrix係數。