Multiply Method

# Matrix.Multiply Method

.NET Framework 3.0
Multiplies a Matrix structure by another Matrix structure.

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

## Syntax

```public static Matrix Multiply (
Matrix trans1,
Matrix trans2
)
```
```public static Matrix Multiply (
Matrix trans1,
Matrix trans2
)
```
```public static function Multiply (
trans1 : Matrix,
trans2 : Matrix
) : Matrix
```
```You cannot use methods in XAML.
```

#### Parameters

trans1

The first Matrix structure to multiply.

trans2

The second Matrix structure to multiply.

#### Return Value

The result of multiplying trans1 by trans2.

## Remarks

Matrix multiplication is not commutative. Multiplying trans1 by trans2 is not the same as multiplying trans2 by trans1.

## Example

The following example shows how to multiply two Matrix structures.

```private void multiplicationExample()
{

Matrix matrix1 = new Matrix(5, 10, 15, 20, 25, 30);
Matrix matrix2 = new Matrix(2, 4, 6, 8, 10, 12);

// matrixResult is equal to (70,100,150,220,240,352)
Matrix matrixResult = Matrix.Multiply(matrix1, matrix2);

// matrixResult2 is also
// equal to (70,100,150,220,240,352)
Matrix matrixResult2 = matrix1 * matrix2;

}

```

## Platforms

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.

## Version Information

#### .NET Framework

Supported in: 3.0