Jawab Saving canvas ink as SVG format

  • 06 Agustus 2012 11:30
     
     

    Hi,

    I have an inkstroke in a canvas.I want to save that canvas as SVG format.How can I save that ink in that canvas as SVG and retrieve it back and show again in canvas?

    How to Save and Retrieve SVG from a canvas in C#?Any sample/coding will be appreciated!

Semua Balasan

  • 06 Agustus 2012 23:05
    Moderator
     
     Jawab

    There is no API for this. You would have to implement it yourself.

    You can loop through the strokes collection returned from InkManager.GetStrokes. For each stroke create a new SVG path and add Bezier curves for each segment within the stroke. How to render ink data demonstrates the basic concept. You will need to convert it from JavaScript to C# and from targeting an HTML Canvas to generating SVG elements.

    --Rob