Possible approach for SVG clipping
Hi,
Clipping of SVG vectors could be useful for many users. At present Qt does not support clipping of these vectors, i.e. slicing of SVG images. Of course there are commercial tools that slice SVGs amazingly well.
Below is one approach I had in mind for some time (with inputs from Gunnar) and thought better document here …
1. Use QSvgRenderer to read svg file
2. Modified/extend QSvgGenerator’s drawPath (or drawXXXX) methods to slice various vectors
3. Use Qpainter with QSvgGenerator as the paint device, to generate svg, which now has the vectors sliced
4. For complex shapes, one could use the QPathClipper class to help out
Thoughts/comments?
2 replies
SVG clipping is more like buddy system….My point of view is data centric to add to above API centric info..
SVG is a collection of drawn blocks..Now these blocks are drawn and can be clipped but clips are formed with nearby blocks combining together just like buddy system from memory allocation.
http://en.wikipedia.org/wiki/Buddy_memory_allocation
My thought is on to get data structure out for storing and forming clip so that if possible clips can be SVG or other desired format in the effecient way.
You must log in to post a reply. Not a member yet? Register here!


