PDA

View Full Version : Support of transformations and render quality in SVG



samgoud_b
1st April 2008, 02:28
Hi,

Can anyone let me know if there is support for

1. Scaling, rotate and panning of SVG content.
2. Setting rendering quality of SVG (i.e high/low with/without antialiasing)

Thanks and Regards,
Sampath

codeslicer
1st April 2008, 03:00
I don't know about that... but here's the QtSvg Module: http://doc.trolltech.com/latest/qtsvg.html (doc.trolltech.com/latest/qtsvg.html)

pherthyl
1st April 2008, 05:23
One option is to use QGraphicsSvgItem to render your SVG and then you will get the scaling/panning/rotation practically for free through the transformations in the graphics view framework. Don't know about rendering quality, I don't think its possible in QtSvg

spud
2nd April 2008, 18:46
Hi,

Can anyone let me know if there is support for

1. Scaling, rotate and panning of SVG content.
2. Setting rendering quality of SVG (i.e high/low with/without antialiasing)

Yes there is.
If you use QSvgRenderer in conjunction with a QPainter you could use (for instance) QPainter::translate(), QPainter::scale(), QPainter::rotate() and QPainter::setRenderHint ( ).
The painter can draw on any paint device (an image, a window, an OpenGL window...) so you can set the resolution by changing the size of the target.

That being said, the best resolution for you might be using QGraphicsScene as pherthyl suggested. See QGraphicsSvgItem::setCachingEnabled and QStyleOptionGraphicsItem::levelOfDetail .