Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transformations data on a Linux OS #1157

Open
gentilinigm opened this issue May 14, 2024 · 0 comments
Open

Transformations data on a Linux OS #1157

gentilinigm opened this issue May 14, 2024 · 0 comments

Comments

@gentilinigm
Copy link

Transformations are handled using the System.Drawing.Drawing2D.Matrix class.
However, System.Drawing.Drawing2D contains some windows-only code, which generates a warning if used.

I'm using this package as a dependency in my project, but when trying to run the project on a Linux OS I get the following error:

Unhandled exception. System.TypelnitializationException: The type initializer for 'Gdip' threw an exception.
—> System.PlatformNotSupportedException: System.Drav/ing.Common is not supported on non-Windows platforms. See https://aka.ms/systemdrav/ingnonv/inc ov/s for more information.

This is my code:

System.Drawing.Drawing2D.Matrix matrix = element.Transforms[i].Matrix;
Transformation transformation = new Transformation();
transformation.Diagonal(1);
transformation[0, 0] = Convert.ToDouble(matrix.Elements[0]);
transformation[1, 0] = Convert.ToDouble(matrix.Elements[1]);
transformation[0, 1] = Convert.ToDouble(matrix.Elements[2]);
transformation[1, 1] = Convert.ToDouble(matrix.Elements[3]);
transformation[0, 3] = Convert.ToDouble(matrix.Elements[4]);
transformation[1, 3] = Convert.ToDouble(matrix.Elements[5]);

Accessing transformations data is essential for my project,
Am I doing something wrong? Do you have any suggestions?

If needed, I can help to transition to another cross-platform Matrix class to handle these types of transformations.

Used Versions

Svg 3.4.7 (nuget)
Debian 11
.NET 6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant