Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.4k views
in Technique[技术] by (71.8m points)

Matrix class C#

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...