Matrix.Prepend(Matrix) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
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 。
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不同。
在複合轉換中,個別轉換的順序很重要。 例如,如果您第一次旋轉,然後調整,然後轉譯,則得到的結果與第一次轉譯、旋轉、縮放結果不同。 其中一個原因是像旋轉和縮放這樣的轉換是相對於座標系統的原點完成的。 當縮放位於原點的物件時,結果會與縮放已從原點移動的物件不同。 同樣地,旋轉位於原點的 物件會產生與旋轉已移離原點的物件不同的結果。