Results 1 to 9 of 9

Thread: Obtain const QImage from QByteArray

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Join Date
    Aug 2010
    Posts
    58
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Obtain const QImage from QByteArray

    What you probably want is:
    from server:
    Qt Code:
    1. QDataStream stream(&arr, QIODevice::WriteOnly);
    2. stream.setVersion(QDataStream::Qt_4_7);
    3.  
    4. QImage image = ...;
    5. stream << image;
    To copy to clipboard, switch view to plain text mode 
    then in client:
    Qt Code:
    1. QDataStream stream(&some_socket, QIODevice::ReadOnly);
    2. stream.setVersion(QDataStream::Qt_4_7);
    3.  
    4. QImage image = ...;
    5. stream >> image;
    To copy to clipboard, switch view to plain text mode 
    The operators are in the documentation, >> and << for QImageHope this helps

  2. The following user says thank you to Fallen_ for this useful post:

    gorsanmo (26th April 2011)

Similar Threads

  1. Replies: 3
    Last Post: 18th November 2010, 17:52
  2. const char* QImage Format?
    By grabalon in forum Newbie
    Replies: 2
    Last Post: 13th May 2010, 00:44
  3. Streaming QImage (QByteArray, QDataStream, QBuffer)
    By knarz in forum Qt Programming
    Replies: 5
    Last Post: 17th January 2009, 22:05
  4. Constructing QImage from QBytearray
    By dbrmik in forum Newbie
    Replies: 6
    Last Post: 16th December 2008, 15:00
  5. QImage to QByteArray
    By navi1084 in forum Qt Programming
    Replies: 5
    Last Post: 15th October 2008, 09:36

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.