Skip to content

.NET 6 - System.Drawing.Common is no longer supported on non-Windows systems #929

Open
@dstj

Description

@dstj

With .NET 6, System.Drawing.Common become a "Windows-only" dependency.

See this official Microsoft note about the breaking change. They it's mainly because libgdiplus used on Linux systems is "subpar".

SVG uses System.Drawing.Common, thus libgdiplus, so it's having issues with my docker image based on aspnet:6.0-alpine . Any plans to migrate to one of the recommended alternatives?

Recommended action
To use these APIs for cross-platform apps, migrate to one of the following libraries:

ImageSharp
SkiaSharp
Microsoft.Maui.Graphics

--
Sidenote: the reason I got into this is because I have an alignment issue under Linux that I do not have under Windows.

image

The code relies on amountSvgText.Dx = new SvgUnitCollection { new(SvgUnitType.Pixel, CONSTANT - amountSvgText.Bounds.Width) }; and I believe the culprit is libgdiplus.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions