言語

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;
}

注釈

複合変換では、個々の変換の順序が重要です。 たとえば、最初に回転し、その後に拡大縮小してから平行移動するのと、最初に平行移動し、その後に回転して拡大縮小するのでは、異なる結果が得られます。 順序が重要な理由の 1 つは、座標系の原点に対して回転やスケーリングなどの変換が行われることです。 原点を中心とするオブジェクトをスケーリングすると、原点から離れたオブジェクトのスケーリングとは異なる結果が生成されます。 同様に、原点を中心とするオブジェクトを回転すると、原点から離れたオブジェクトを回転する場合とは異なる結果が得られます。

適用対象