-6

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

Eslam Ahmed
  • 19
  • 1
  • 2
  • 6
    that is for visuals, not mathematical matrices. – Daniel A. White Oct 09 '15 at 15:19
  • I would use MATLAB for that kind of stuff. – John Paul Oct 09 '15 at 15:52
  • @DanielA.White sorry, what is the difference between visual and mathematical matrices? Do you mean that math matrices don't implement rotate, scale, transform and so on? Does this mean that visual matrix just has more functionality? – Yola Nov 01 '18 at 10:14
  • 1
    @Yola what i meant was that namespace is not general purpose like mathematical matrices, hence the restrictions. the `Matrix` data type is for what you just described, not general purposes. – Daniel A. White Nov 01 '18 at 12:50

1 Answers1

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.

Jaka Konda
  • 1,385
  • 3
  • 13
  • 35