语言

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 坐标。

示例

以下示例演示如何将刻度追加到 a 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;
}

注解

在复合转换中,各个转换的顺序非常重要。 例如,如果首先旋转,然后缩放,然后平移,得到的结果会与首先平移,然后旋转,然后缩放的结果不同。 顺序的重要性之一是,诸如旋转和缩放的转换是相对于坐标系的原点进行的。 缩放以原点为中心的对象会生成不同于缩放已移出原点的对象的结果。 同样,旋转原点居中的对象会产生不同于旋转已移出原点的对象的结果。

适用于