问题
I'm trying to make some geometric transformations (e.g. scale,shear) on an image already loaded in a bitmap object
I then found a Built-in Matrix class in C# , I used it but I'm not sure on how to initialize a 2x2 matrix or a column vector etc.
The 4th overloaded constructor forces me to enter 6 values representing 3x2 ,but that I don't want!
I used this reference but couldn't find an answer
https://msdn.microsoft.com/en-us/library/system.drawing.drawing2d.matrix(v=vs.110).aspx
回答1:
As @Daniel pointed out, System.Drawing.Drawing2D.Matrix
is for visual geometrical transformations only, not mathematical.
If you'd like mathematical transformations I'd recommend you take a look at Math.NET or what I'd recommend, OpenCV library. OpenCV is written in C++, but has an excellent C# wrappers. It can be easily installed via Nuget.
来源:https://stackoverflow.com/questions/33041874/matrix-class-c-sharp