Is it possible to convert standart System.Drawing.Graphics methods such as DrawImage, DrawPath and other to html5 canvas methods such as context.drawImage and context.beginPath(); ... context.closePath(); respectively via Script# or other C# to JS converters?
How can I do it automatically without .js file editing after compilation?
I had the same issue.
The way you draw on the canvas is not completely the same as by using System.Drawing.Graphics. A solution is to create an abstraction over System.Drawing.Graphics like this:
In the script# creat a class that implements this interface and made the calls native to the canvas using the script# System.Html.Media.Graphics namespace.
In the C# project do the same but use System.Drawing.Graphics
Next thing is refactoring the existing drawing code to use IDrawingContext instead of System.Drawing.Graphics