0

I have a UWP app that uses an InkCanvas to capture drawings. These are then saved in the standard serialization format.

I now have a requirement to display these within a ASP.NET MVC web app. (MVC 5 / .NET 4.6)

I have found a way to convert these to SVG - however it uses the UWP InkCanvas control, which I do not believe is accessible from with in an ASP.NET app. I have tried using the WPF version of the control instead - but that appears to use a different serialization format.

Now, is there any way to me to convert the strokes to SVG without using the control?

I can also think of a few other messy solutions to achieve this - converting to SVG directly in the UWP app (then need to store both the source InkCanvas data and SVG data, and keep these in sync) - so looking for a cleaner approach.

Nick Goloborodko
  • 2,883
  • 3
  • 21
  • 38
  • 1
    It appear the [standard serialization format](https://learn.microsoft.com/en-us/windows/uwp/design/input/save-and-load-ink) is ISF, and it can be displayed like a plain GIF file in ASP.NET, does not need to convert to SVG at all. Is the file extension `.gif` or something else? – kennyzx Jul 25 '18 at 07:50
  • Thanks for the reply - yes that is another option. My only issue with that is it isn't antialiased and looks terrible. There are also non ink strokes (overlayed custom shapes that are not part of the ink canvas data) that would be a nightmare to draw on gif – Nick Goloborodko Jul 25 '18 at 07:55
  • I see. From my personal experience, consuming WinRT API is quite hard in ASP.NET, you can compile the code, but it fails at runtime, they are not designed to interop each other. So have better spend the effort on the UWP app, make it generate images suitable for displaying. – kennyzx Jul 25 '18 at 12:34

0 Answers0