Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to draw a line in Blazor?

Literally how to draw a line in Blazor? I have seen this project on GitHub and it is a wrapper of HTML canvas and I've also seen this question, and this article among others and they seem to make calls through JavaScript to draw on a canvas so it basically executes as plain JS code.

I wonder if there is another way to draw line and create animations like in Blazor that should have close to native performance.

Is there an alternative to HTML canvas and keep wrapping JS calls in order to create draw lines like animations, like something official that supports this kind of functionality?

like image 288
meJustAndrew Avatar asked Nov 12 '19 20:11

meJustAndrew


1 Answers

No, there is no currently no alternative and nothing is build into Blazor for this.

Blazor uses web technologies to render the user interface.

Even if Blazor would offer a build-in way to draw stuff that would be nothing else than an opininated API over canvas or WebGL.

Nevertheless, I hope that the team will one day decide to create such an in build-in API for drawing on the canvas. Those drawing capabilities will make Blazor even more attractive for a lot of users. Take a look at the huge success of p5js and the amount of new programmers that p5js has brought to the javascript community.

I think the chance that Blazor team will take up such a task is pretty low, they probably hope the community will do it. However, the chances to get a great Windows Graphic Rendering Library from MS was pretty low as well and we got Shawn Hargreaves creating the awesome Win2D library. So let's keep the finger crossed!

like image 107
Postlagerkarte Avatar answered Sep 29 '22 23:09

Postlagerkarte