dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.42k stars 4.75k forks source link

[API Proposal]: Implement drawing API #106373

Open n2029-ndensan opened 3 months ago

n2029-ndensan commented 3 months ago

Background and motivation

I would like you to implement a drawing API that works on Windows and Linux. The developer of the form middleware says that it is not possible to develop .NET because it lacks a drawing API. The developer is also developing a Java version. Since it can be developed with Java, I think it would be possible if .NET also implemented a drawing API equivalent to Java, so I would like it to be supported.

API Proposal

API Usage

Alternative Designs

No response

Risks

No response

dotnet-policy-service[bot] commented 3 months ago

Tagging subscribers to this area: @dotnet/area-system-drawing See info in area-owners.md if you want to be subscribed.

Clockwork-Muse commented 3 months ago

It is possible, it's just not something the runtime provides (currently).

There are third-party packages that provide this functionality, like SkiaSharp and others.

n2029-ndensan commented 3 months ago

Thank you for your reply. Does this mean that there are no plans to implement it in runtime? Is it correct to assume that SkiaSharp is the de facto standard?

Clockwork-Muse commented 3 months ago

As near as I'm aware, there are no current plans to implement one - there used to be one based on Windows APIs, but the maintenance burden was too high.

SkiaSharp is one of the many implementations, you'll have to figure out which is the best one for your needs.

samsosa commented 3 months ago

I can recommend the impressive ImageSharp Project.

n2029-ndensan commented 3 months ago

ImageSharp is paid, so SkiaSharp is better.

julealgon commented 3 months ago

...it's just not something the runtime provides (currently). ...there are no current plans to implement one - there used to be one based on Windows APIs, but the maintenance burden was too high.

@Clockwork-Muse if you don't mind me asking, how does something like MAUI get around this? Doesn't that framework eventually have to implement cross-platform drawing/rendering?

Clockwork-Muse commented 3 months ago

Maui "gets around it" by using SkiaSharp on the platforms that use the mono runtime, and a Windows-specific library on Windows.

That said, there's nothing actually preventing a library including their own cross-platform drawing framework (other than the effort involved).

n2029-ndensan commented 3 months ago

The .NET library had the following. Microsoft.Maui.Graphics https://maui.graphics/ I think GDI+ was unable to display Unicode combined characters and IVS correctly. Is this API DirectWrite type? DirectWrite is recognized to be able to display combined characters and IVS correctly. Based on my experience with .NET Framework.