Results 1 to 6 of 6

Thread: How to return pixels from QPixmap to QML

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2012
    Posts
    18
    Thanked 9 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default How to return pixels from QPixmap to QML

    Hello, How would one return Image bits to QML from C++?

    I have this code in c++:
    ....
    Qt Code:
    1. QImage image = m_pixmap.copy(sx, sy, sw, sh).toImage();
    2.  
    3. image = image.convertToFormat(QImage::Format_ARGB32);
    4. QByteArray bytes((char *) image.bits(), image.byteCount());
    5.  
    6. return ?????
    To copy to clipboard, switch view to plain text mode 
    How would I package up the QByteArray properly and return the data to QML in rgba format, so it can be manipulated on the QML side?

    Thanks

  2. The following 3 users say thank you to cmessineo for this useful post:


Similar Threads

  1. Replies: 1
    Last Post: 2nd January 2013, 09:48
  2. Replies: 4
    Last Post: 28th August 2008, 13:13
  3. Replies: 1
    Last Post: 21st August 2008, 07:44
  4. QPixmap replace white pixels by blacks
    By bunjee in forum Qt Programming
    Replies: 1
    Last Post: 20th August 2008, 05:12
  5. Replies: 5
    Last Post: 9th April 2007, 14:26

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.