mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-03 21:25:13 +00:00
System.Drawing.Common is targeted at Windows only #732
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @danatcofo on GitHub (Dec 9, 2021).
This is related to forward support for .net 6 as added in #636.
The issue is that System.Drawing.Common isn't fully cross platform supported so while it won't break on every system its not stable for all use-cases. The issue is described by Microsoft here
This issue doesn't really present within the .net 5 ecosystem but will likely cause issues going forward. Microsoft recommends the following alternatives.
We need to use one of these repos or a suitable equivalent as appropriate and update usages within NativeImage.cs as appropriate.
Feedback on replacements welcome.
@bman46 commented on GitHub (Dec 10, 2021):
I spent a bit of time looking into this and it appears that ImageSharp doesn't support bitmaps. Maui is in prerelease and doesn't really have any documentation. SkiaSharp seems pretty good but it won't be a drop in replacement and will break compatibility.
Edit: ImageSharp supports bitmaps but not portable bitmaps. So it would likely be a candidate.
@danatcofo commented on GitHub (Dec 10, 2021):
Maui has been prerelease for 10 years and still gets regularly updated. According to the Maui docs it's used internally in MS many places. I think I would be ok with it.
@antonfirsov commented on GitHub (Dec 13, 2021):
PBM is a very special and rare format being implemented as a community contribution in the mentioned PR. Otherwise, ImageSharp is pretty much feature feature complete and stable.
The optimal choice depends on the services implemented by the
NativeImageinfrastructure. To me it looks like it mostly deals with encoding/decoding, offscreen resize/crop, serialization/deserialization (for clipboard services?). ImageSharp is good and performant at those things when targeting Desktop platforms powered by coreclr. I can help with potential adaption.