Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Matrix.ScalePrepend Method (Double, Double)

 

Prepends the specified scale vector to this Matrix structure.

Namespace:   System.Windows.Media
Assembly:  WindowsBase (in WindowsBase.dll)

public void ScalePrepend(
	double scaleX,
	double scaleY
)

Parameters

scaleX
Type: System.Double

The value by which to scale this Matrix structure along the x-axis.

scaleY
Type: System.Double

The value by which to scale this Matrix structure along the y-axis.

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.

The following example shows how to prepend a scale to a Matrix structure.


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;

}        

.NET Framework
Available since 3.0
Return to top
Show:
© 2017 Microsoft