Menu

SVG Question

2021-11-29
2021-12-03
  • Herbert M Sauro

    Herbert M Sauro - 2021-11-29

    I've started using image32 and so far so good. I realise that its a raster based library but is there any way to export to SVG once an image has been constructed?

     
  • Angus Johnson

    Angus Johnson - 2021-11-30

    Hi Herbert.
    Mostly no unless it's a very simple raster image (eg see the vectorize sample app).
    You could in theory record the image editing instructions you make and convert these into SVG instructions but that would be a huge amount of work.

     
  • Herbert M Sauro

    Herbert M Sauro - 2021-11-30

    Thanks, that's what I suspected.

     
  • Rob Lambden

    Rob Lambden - 2021-12-03

    Hi Herbert, I have my own shape class I use which renders lines and bezier curves to an Image32. If you use something like that then it would be relatively simple to "render" that to an SVG file. I haven't done it as I have no need. If you are internally recognising that an image is vector based, and you use vector drawing commands to render it, (for example for arbitrary scaling) then you should be able to recreate the drwing instructions as an SVG file.

    Once the data is in a raster format then you don't have vectors to save.

    I haven't used any of the vectorising features myself, but as Angus suggests that would be another way to go.

     
  • Herbert M Sauro

    Herbert M Sauro - 2021-12-03

    @Rob, I thought about that and in recent days I have played around with a simple api for generating SVG. I generally only used the most basic things like shapes, lines, colors and maybe gradients. With that its should be doable to create a separate SVG class that records the operations are it get routed to TImage32.