Results 1 to 9 of 9

Thread: QPixmap reading

  1. #1
    Join Date
    Oct 2008
    Posts
    306
    Thanks
    6
    Thanked 9 Times in 8 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Post QPixmap reading

    What's faster? Read a pixmap saved to a file, or read one from a file?

  2. #2
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QPixmap reading

    i m sorry but both of your questions are one and the same. try to rephrase

  3. #3
    Join Date
    Oct 2008
    Posts
    306
    Thanks
    6
    Thanked 9 Times in 8 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QPixmap reading

    Read a pixmap saved to a file:
    I read a pixmap saved inside an .xml file.
    Ex:
    <?xml version="1.0"?>
    <pixmap>
    01010110011001010101001
    01001001001001010100100
    </pixmap>

    Read a pixmap from a file:
    Ask QT to grab the icon from explorer.exe, and make a QPixmap out of it.

  4. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: QPixmap reading

    Quote Originally Posted by been_1990 View Post
    Read a pixmap saved to a file:
    I read a pixmap saved inside an .xml file.
    Ex:
    <?xml version="1.0"?>
    <pixmap>
    01010110011001010101001
    01001001001001010100100
    </pixmap>
    Sorry, but who does such thing? It's "stupid", why not easily save it in the original file format or any other better.
    Read a pixmap from a file:
    Ask QT to grab the icon from explorer.exe, and make a QPixmap out of it.
    Don't understand. What icon? Do you mean a normal image file, which lays on your hard disk? If so, that's the way!

  5. #5
    Join Date
    Oct 2008
    Posts
    306
    Thanks
    6
    Thanked 9 Times in 8 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QPixmap reading

    I mean an applications icon retrieved with QFileIconProvider .

  6. #6
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QPixmap reading

    if you are only concerned with speed... just do a test yourself

    Qt Code:
    1. QTime time;
    2. time.start();
    3. Read_a_pixmap_saved_to_a_file();
    4. qDebug<<"Time taken = "<<time.elapsed()<<"ms";
    5.  
    6. time.restart();
    7. Read_a_pixmap_from_a_file();
    8. qDebug<<"Time taken = "<<time.elapsed()<<"ms";
    To copy to clipboard, switch view to plain text mode 

  7. #7
    Join Date
    Oct 2008
    Posts
    306
    Thanks
    6
    Thanked 9 Times in 8 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QPixmap reading

    Ok. But wich one would use less system resources?

  8. #8
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QPixmap reading

    ultimately you will read the same amount of data (image) from any method.

  9. #9
    Join Date
    Oct 2008
    Posts
    306
    Thanks
    6
    Thanked 9 Times in 8 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QPixmap reading

    Ok. If thats the case... Thanks.

Similar Threads

  1. Position in a QPixMap created from a QGraphicsScene
    By stevel in forum Qt Programming
    Replies: 8
    Last Post: 8th April 2009, 22:39
  2. How to Compile VTKDesigner2 with Qt?
    By alfredoaal in forum Newbie
    Replies: 0
    Last Post: 5th September 2008, 05:34
  3. Reading of ascii-file to QPixMap
    By fluxar in forum Newbie
    Replies: 4
    Last Post: 15th November 2007, 14:31
  4. QWT 5, QT3, SuSE 10.2. Crash and burn
    By DrMcCleod in forum Qwt
    Replies: 8
    Last Post: 7th September 2007, 20:53
  5. QPixmap and HBITMAP
    By ToddAtWSU in forum Qt Programming
    Replies: 1
    Last Post: 21st June 2006, 16:24

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
  •  
Qt is a trademark of The Qt Company.