我正试着把2个矩阵相乘。我是using System.Windows.Media,但我仍然得到了矩阵下面的红色弯曲。我可以看出using System.Windows.Media正在注册,因为它让我决定我的Color是使用System.Windows.Media还是System.Drawing。下面是我的代码:
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;有什么建议解释为什么代码不能识别using System.Windows.Media吗?我已经添加了PresentationCore引用。
发布于 2014-03-14 09:06:44
试着把这个放在你的.cs的顶端:
using Matrix = System.Windows.Media.Matrix;这可能是因为您的导入中既有System.Windows.Media又有System.Drawing
https://stackoverflow.com/questions/22393824
复制相似问题