Results 1 to 4 of 4

Thread: Support of transformations and render quality in SVG

  1. #1

    Default Support of transformations and render quality in SVG

    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

  2. #2
    Join Date
    Feb 2008
    Posts
    153
    Thanks
    40
    Thanked 8 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Support of transformations and render quality in SVG

    I don't know about that... but here's the QtSvg Module: http://doc.trolltech.com/latest/qtsvg.html

  3. #3
    Join Date
    Aug 2006
    Posts
    250
    Thanks
    19
    Thanked 49 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Support of transformations and render quality in SVG

    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

  4. #4
    Join Date
    Oct 2006
    Posts
    279
    Thanks
    6
    Thanked 40 Times in 39 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Support of transformations and render quality in SVG

    Quote Originally Posted by samgoud_b View Post
    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.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.