Matrix.Prepend(Matrix) Matrix.Prepend(Matrix) Matrix.Prepend(Matrix) Method

定義

在這個 Matrix 結構之前加上指定的 Matrix 結構。Prepends the specified Matrix structure onto this Matrix structure.

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

參數

matrix
Matrix Matrix Matrix

要在這個 Matrix 結構之前加上的 Matrix 結構。The Matrix structure to prepend to this Matrix structure.

範例

下列範例顯示如何在另Matrix Matrix一個前面加上。The following example shows how to prepend a Matrix onto another 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結構的參數相乘相同。This operation is the same as multiplying the parameter matrix by this Matrix structure. 但是矩陣乘法不是可交換的, 因此這Matrix項作業與此結構的參數matrix不相同, 也就是matrix * 這與此 * matrix不同。Matrix multiplication is not commutative, however, so this operation is not the same as multiplying this Matrix structure by the parameter matrix; that is, matrix * this is not the same as this * matrix.

在複合轉換中, 個別轉換的順序很重要。In a composite transformation, the order of individual transformations is important. 例如, 如果您先旋轉, 然後調整規模, 然後轉譯, 則會得到不同的結果, 而不是您第一次轉譯, 然後旋轉再調整。For example, if you first rotate, then scale, then translate, you get a different result than if you first translate, then rotate, then scale. 其中一個原因是很重要的, 就是旋轉和縮放之類的轉換是根據座標系統的原點來完成。One reason order is significant is that transformations like rotation and scaling are done with respect to the origin of the coordinate system. 調整以原點為中心的物件, 會產生不同的結果, 而不是縮放已從原點移出的物件。Scaling an object that is centered at the origin produces a different result than scaling an object that has been moved away from the origin. 同樣地, 旋轉原點中央的物件, 會產生不同的結果, 而不是旋轉離開來源的物件。Similarly, rotating an object that is centered at the origin produces a different result than rotating an object that has been moved away from the origin.

適用於

另請參閱