Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is is possible to convert only a part of the canvas? #87

Open
FrankDaze opened this issue Jul 28, 2022 · 5 comments
Open

Is is possible to convert only a part of the canvas? #87

FrankDaze opened this issue Jul 28, 2022 · 5 comments

Comments

@FrankDaze
Copy link

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.

image

I like to build something similar in my own tool.

Thanks in advance
Frank

@murkle
Copy link

murkle commented Jul 28, 2022

Yes, just use the standard canvas clipping operations

@FrankDaze
Copy link
Author

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.

@murkle
Copy link

murkle commented Jul 28, 2022

Try it - you can probably set the bounding box and/or the origin in the SVG

@FrankDaze
Copy link
Author

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

@jayykumar
Copy link

jayykumar commented Sep 9, 2022

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants