Matrix.Prepend(Matrix) 方法

定義

在這個 Matrix 結構之前加上指定的 Matrix 結構。

public:
 void Prepend(System::Windows::Media::Matrix matrix);
public void Prepend (System.Windows.Media.Matrix matrix);
member this.Prepend : System.Windows.Media.Matrix -> unit
Public Sub Prepend (matrix As Matrix)

參數

matrix
Matrix

要在這個 Matrix 結構之前加上的 Matrix 結構。

範例

下列範例示範如何將 前面加上 Matrix 另一個 Matrix

private Matrix prependExample()
{

    Matrix matrix1 = new Matrix(5, 10, 15, 20, 25, 30);
    Matrix matrix2 = new Matrix(2, 4, 6, 8, 10, 12);

    matrix1.Prepend(matrix2);

    // matrix1 is equal to (70,100,150,220,255,370). 
    return matrix1;
}

備註

這項作業與將 參數 matrix 乘以這個 Matrix 結構相同。 不過,矩陣乘法不是交換的,因此此作業與將這個 Matrix 結構乘以參數 matrix 不同;也就是說, matrix * 這與這個 * matrix 不同。

在複合轉換中,個別轉換的順序很重要。 例如,如果您第一次旋轉,然後縮放,則轉譯會得到與第一次轉譯、旋轉、縮放結果不同的結果。 其中一個原因是旋轉和縮放等轉換是在座標系統的原點上完成。 縮放位於原點的物件會產生與調整已移出原點的物件不同的結果。 同樣地,旋轉位於原點的物件會產生與旋轉已從原點移開的物件不同的結果。

適用於

另請參閱