Results 1 to 2 of 2

Thread: Serializing QImage

  1. #1
    Join Date
    Aug 2008
    Posts
    50
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Serializing QImage

    In qt doc:
    http://doc.qt.nokia.com/4.7/datastreamformat.html
    is written:
    ... If you want control of the format, stream the image into a QBuffer (using QImageIO) and stream that.
    Can anyone explain me how can I "stream the image into a QBuffer (using QImageIO) and stream that"?(Maybe some minimal C++ example?)

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Serializing QImage

    Qt Code:
    1. QBuffer buffer;
    2. image.save(&buffer, "PNG");
    3. QDataStream stream;
    4. // ...
    5. stream << buffer.data();
    To copy to clipboard, switch view to plain text mode 
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


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

    lukass (26th October 2010)

Similar Threads

  1. QImage and Qt 4.5.3
    By halmassi in forum Newbie
    Replies: 26
    Last Post: 10th March 2010, 21:49
  2. Serializing
    By xyzt in forum Qt Programming
    Replies: 1
    Last Post: 23rd March 2008, 08:51
  3. What's faster: QPixmap-to-QImage or QImage-to-QPixmap
    By forrestfsu in forum Qt Programming
    Replies: 2
    Last Post: 15th December 2006, 17:11
  4. QImage
    By mickey in forum Qt Programming
    Replies: 7
    Last Post: 14th July 2006, 21:54
  5. Replies: 3
    Last Post: 15th March 2006, 11:44

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.