简体   繁体   中英

C# Matrix Multiplication Library

I am trying to multiply 2 matrices. I am using System.Windows.Media , but I am still getting the red squigglies under Matrix. I can tell that using System.Windows.Media is registering, because it wants me to decide if I want to use System.Windows.Media or System.Drawing for my Color s. Here is my code:

        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;

Any suggestions why the code is not picking up on using System.Windows.Media ? I have added the PresentationCore reference already.

try putting this at the top of your .cs:

using Matrix = System.Windows.Media.Matrix;

This is probably occurring because you have System.Windows.Media as well as System.Drawing in your imports

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM