Matrix.Equality(Matrix, Matrix) Matrix.Equality(Matrix, Matrix) Matrix.Equality(Matrix, Matrix) Matrix.Equality(Matrix, Matrix) Operator

定義

判斷兩個指定的 Matrix 結構是否相同。Determines whether the two specified Matrix structures are identical.

public:
 static bool operator ==(System::Windows::Media::Matrix matrix1, System::Windows::Media::Matrix matrix2);
public static bool operator == (System.Windows.Media.Matrix matrix1, System.Windows.Media.Matrix matrix2);
static member ( = ) : System.Windows.Media.Matrix * System.Windows.Media.Matrix -> bool
Public Shared Operator == (matrix1 As Matrix, matrix2 As Matrix) As Boolean

參數

matrix1
Matrix Matrix Matrix Matrix

要比較的第一個 Matrix 結構。The first Matrix structure to compare.

matrix2
Matrix Matrix Matrix Matrix

要比較的第二個 Matrix 結構。The second Matrix structure to compare.

傳回

如果 matrix1matrix2 相同則為 true,否則為 falsetrue if matrix1 and matrix2 are identical; otherwise, false.

範例

下列範例顯示如何檢查兩個Matrix結構是否相等。The following example shows how to check two Matrix structures for equality.

private void equalityExample()
{

    Matrix matrix1 = new Matrix(5, 10, 15, 20, 25, 30);
    Matrix matrix2 = new Matrix(5, 10, 15, 20, 25, 30);
    
    Boolean result;
    
    // result is true.
    result = (matrix1 == matrix2);            
    
    // result is false.
    result = (matrix1 != matrix2);

}

備註

注意

Matrix將其值儲存為雙精確度浮點數。A Matrix stores its values as doubles. 在對其執行算術Double運算時, 的值可能會失去精確度, 因此邏輯上相等的Double兩個結構之間的比較可能會失敗。Because the value of a Double can lose precision when arithmetic operations are performed on it, a comparison between two Double structures that are logically equal might fail.

適用於

另請參閱