Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Matrix.Scale Method

Appends the specified scale vector to this Matrix structure.

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

public void Scale (
	double scaleX,
	double scaleY
)
public void Scale (
	double scaleX, 
	double scaleY
)
public function Scale (
	scaleX : double, 
	scaleY : double
)
You cannot use methods in XAML.

Parameters

scaleX

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

scaleY

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

The following example shows how to scale a Matrix structure.


private Matrix scaleExample()
{
    Matrix myMatrix = new Matrix(5, 10, 15, 20, 25, 30);
    
    // Scale myMatrix by a horizontal factor of 2
    // and a vertical factor of 4 about the origin.
    // After this operation,
    // myMatrix is equal to (10, 40, 30, 80, 50, 120)
    myMatrix.Scale(2, 4);
    
    return myMatrix;

}

private Matrix scaleAboutPointExample()
{
    Matrix myMatrix = new Matrix(5, 10, 15, 20, 25, 30);
    
    // Scale myMatrix by a horizontal factor of 2
    // and a vertical factor of 4 about the 
    // point (100,100).
    // After this operation,
    // myMatrix is equal to (10, 40, 30, 80, -50, -180)
    myMatrix.ScaleAt(2, 4, 100, 100);
    
    return myMatrix;

}        


Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.