Export (0) Print
Expand All

Matrix.Identity Property

Gets an identity Matrix.

Namespace: System.Windows.Media
Assembly: WindowsBase (in windowsbase.dll)
XML Namespace:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

public static Matrix Identity { get; }
/** @property */
public static Matrix get_Identity ()

public static function get Identity () : Matrix

You cannot use this property in XAML.

Property Value

An identity matrix.

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. This correlates to setting M11 and M22 to 1 and M12, M21, OffsetX, and OffsetY to 0. In an affine matrix, which is the implementation that 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.

1

0

0

0

1

0

0

0

1

For an identity matrix, the ToString method returns the string "Identity" instead of the coefficients of the Matrix.

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;
    
       
}

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

ADD
Show:
© 2014 Microsoft