canvas2svg
canvas2svg copied to clipboard
Is is possible to convert only a part of the canvas?
Is is possible to convert only a specific area of the canvas?
This is a screenshot of a tool where you can select the area that you like to export.

I like to build something similar in my own tool.
Thanks in advance Frank
Yes, just use the standard canvas clipping operations
If I use clip() everything is only drawn inside the clip path, but if I export the canvas, it's still the whole canvas and not only the part in the clip path.
Correct me if I'm wrong.
Try it - you can probably set the bounding box and/or the origin in the SVG
my idea is now to translate the selected / clipped area to the upper left corner and set the canvas size to the clip size.
I think then I get only the the objects which are drawn in the selection and the file is really small.
thanks for brainstorming
@FrankDaze I m also looking for similar solution. I was able to clip the region, but not able to translate to desired location.could you please shared code used for your logic.