Matrix.ScaleAtPrepend(Double, Double, Double, Double) 方法

定義

在這個 Matrix 前面加上以指定的點為中心的所指定縮放。

public:
 void ScaleAtPrepend(double scaleX, double scaleY, double centerX, double centerY);
public void ScaleAtPrepend (double scaleX, double scaleY, double centerX, double centerY);
member this.ScaleAtPrepend : double * double * double * double -> unit
Public Sub ScaleAtPrepend (scaleX As Double, scaleY As Double, centerX As Double, centerY As Double)

參數

scaleX
Double

X 軸的縮放因數。

scaleY
Double

Y 軸的縮放因數。

centerX
Double

要做為縮放作業中心點的 X 座標。

centerY
Double

要做為縮放作業中心點的 Y 座標。

範例

下列範例示範如何將小數位數 Matrix 前面加上 。


private Matrix scalePrependExample()
{
    Matrix myMatrix = new Matrix(5, 10, 15, 20, 25, 30);
    
    // Prepend a scale ab with a horizontal factor of 2
    // and a vertical factor of 4 about the origin.
    // After this operation,
    // myMatrix is equal to (10, 20, 60, 80, 25, 30)
    myMatrix.ScalePrepend(2, 4);
    
    return myMatrix;
}

private Matrix scalePrependAboutPointExample()
{
    Matrix myMatrix = new Matrix(5, 10, 15, 20, 25, 30);
    
    // Prepend a scale with a horizontal factor of 2
    // and a vertical factor of 4 about the 
    // point (100,100).
    // After this operation,
    // myMatrix is equal to (10, 20, 60, 80, -4975, -6970)
    myMatrix.ScaleAtPrepend(2, 4, 100, 100);
    
    return myMatrix;
}

備註

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

適用於