Results 1 to 3 of 3

Thread: Should I use SVG or something else?

  1. #1
    Join Date
    Mar 2006
    Posts
    46
    Thanks
    8
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Should I use SVG or something else?

    I need to create some dynamically-defined virtual gauges similar to the ones show in this Trolltech demo :


    http://trolltech.com/files/embedded-...s-catalog-demo

    Unlike this demo, I need to make my gauges have different numbers of tick marks, different units, text, sweep ranges, etc. depending on what parameters are being displayed. I can do this by having my program generate the SVG XML on the fly and then send this in-memory file to the SVG renderer, but I wonder if at that point it just makes more sense to just do direct GUI drawing via Qt or OpenGL.

    I guess my question is - is the SVG renderer better in terms of scaling, anti-aliasing, graphics primitives, gradients, etc. to justify the extra step of generating the XML for SVG versus drawing everything via a graphics API?

    Thanks,

    Colby

  2. #2
    Join Date
    Nov 2008
    Posts
    38
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Should I use SVG or something else?

    I'd say you're better off using SVG for perhaps the layer of gloss or background, but as far as tick intervals and the like goes, if you're going to have to specify them programmatically anyway I can't image there's any advantage of generating SVG to issuing drawing commands directly.

    In short, break your widget up into independent pieces. Some can be SVG.

  3. The following user says thank you to spraff for this useful post:

    cboles (10th December 2008)

  4. #3
    Join Date
    Mar 2006
    Posts
    46
    Thanks
    8
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Should I use SVG or something else?

    Quote Originally Posted by spraff View Post
    I'd say you're better off using SVG for perhaps the layer of gloss or background, but as far as tick intervals and the like goes, if you're going to have to specify them programmatically anyway I can't image there's any advantage of generating SVG to issuing drawing commands directly.

    In short, break your widget up into independent pieces. Some can be SVG.
    The one thing that I like about SVG is that is seems to do a very good scaling / anti-aliasing. If you look at the gauges in the demo EXE and shrink down the window, it does a very good job. Most other drawing APIs I have seem tend to have more aliasing, or maybe don't composite the image before scaling to get the anti-aliasing right. I don't know this is true of Qt until I try it both ways and compare of course, but that is the impression I get looking at a lot of other Qt demos.

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.