Results 1 to 4 of 4

Thread: How can I extract raw data from a QPixmap?

  1. #1
    Join Date
    Apr 2009
    Posts
    132
    Thanks
    67
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question How can I extract raw data from a QPixmap?

    Hi dudes!

    After doing a sprite sheet creator, I'd like to convert it from PNG (actually a QPixmap on memory) to PVR (a propietary iPhone compressed format).

    Creating a PVR texture with PVRLib requires evidently I pass it a pointer to my image, using raw format. It is similar to glTexImage2D and its "const GLvoid *pixels" parameter.

    My question is how can I extract a raw image or pointer from a QPixmap? Or should I convert this QPixmap to QImage or QPicture....?
    After reading docs I don't see anything, or maybe I'm blind

    Thanks a lot for your help.

  2. #2
    Join Date
    Apr 2009
    Posts
    132
    Thanks
    67
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How can I extract raw data from a QPixmap?

    Anyone?

    Please...

  3. #3
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How can I extract raw data from a QPixmap?

    Am not sure but may be QImage::bits might be of some use to you

  4. #4
    Join Date
    Sep 2009
    Posts
    140
    Thanks
    4
    Thanked 17 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How can I extract raw data from a QPixmap?

    yes that's it.

    Since QPixmap is dedicated to display , QImage is for pixel access and it can be uses as a wrapper of some buffer when using the constructor that takes char* in argument.

    Be aware of QBitmap copies, in passing or returning arguments when manipulating data.

Similar Threads

  1. QPixmap Display RGB data
    By phoenixtju in forum Qt Programming
    Replies: 2
    Last Post: 27th May 2009, 10:31
  2. QPixmap: X11 "memory leak" due to shared pixmap data?
    By chezifresh in forum Qt Programming
    Replies: 0
    Last Post: 21st April 2009, 19:53
  3. Construct QPixmap or QImage from raw data.
    By The Storm in forum Qt Programming
    Replies: 5
    Last Post: 1st December 2008, 08:21
  4. Replies: 2
    Last Post: 29th September 2008, 00:08
  5. Loading a QPixmap from raw data
    By pherthyl in forum Qt Programming
    Replies: 1
    Last Post: 27th January 2008, 10:12

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.