Results 1 to 2 of 2

Thread: Drawing speed: QPixmap vs QPicture

  1. #1
    Join Date
    May 2007
    Location
    Lublin, Poland
    Posts
    345
    Thanks
    40
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Drawing speed: QPixmap vs QPicture

    Hi,

    I am planning to use QPixmaps or QPicture. I have to draw 1000 elements(which are simple shapes, or more complex ones build of simple ones). I also need to use some of them as "backgrounds" so decided to use QPixmap class. I could use QPixmap item for drawing point element as well as background(setBrush(QBrush(QPixmap file)). Still, I am not sure will this be the best solution. Maybe, it would be better to store elements as .pic files and draw them later using a painter in the background of my scene?

    Is drawing a QPicture faster than QPixmap?


    Thanks for any idea.

    Maverick
    Qt allows you to use everything you want
    wysota
    --------------------------------------------------------------------------------
    #if defined(Q_OS_UNIX) && defined(QT_DEBUG)
    abort(); // trap; generates core dump
    #else
    exit(1); // goodbye cruel world
    #endif

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Drawing speed: QPixmap vs QPicture

    Quote Originally Posted by maverick_pol View Post
    Is drawing a QPicture faster than QPixmap?
    QPicture is just a set of commands. If you want to draw it somewhere, Qt will have to execute all of those commands. While QPixmap is a bitmap stored in memory, so drawing it is just a matter of copying a memory region (provided that there are no transformations).

    QPicture is good way for preparing vector graphics. Epecially if you want to save it later as SVG or PostScript.

Similar Threads

  1. Diff between QImage, QPixmap, QPicture
    By nupul in forum Newbie
    Replies: 6
    Last Post: 30th April 2008, 02:02

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.