Results 1 to 5 of 5

Thread: how to convert a bitmap to bit array?

  1. #1
    Join Date
    Aug 2011
    Posts
    19
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default how to convert a bitmap to bit array?

    Hello,

    I have problem with converting bitmap - QImage to bit array.
    I just dont't know which function I have to use.
    Can someone suggest me something?
    Thanks
    Wojtek

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: how to convert a bitmap to bit array?

    Did you read the QImage documentation? Looks like QImage::bits() is exactly what you need.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  3. #3
    Join Date
    Aug 2011
    Posts
    19
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to convert a bitmap to bit array?

    Thanks for reply.
    Yes I did...
    According to the documentation this function returns a pointer to the first pixel data, but I need to store all information about every pixel RGB colors in separate cell.

  4. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: how to convert a bitmap to bit array?

    Well, then it seems like a nested pair of loops based on QImage::height(), QImage::width(), and QImage::pixel() would do it, don't you think?

  5. #5
    Join Date
    Aug 2011
    Posts
    19
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to convert a bitmap to bit array?

    Thank you.

Similar Threads

  1. Bitmap to byte array
    By Otherside in forum Newbie
    Replies: 6
    Last Post: 15th January 2012, 21:17
  2. convert 16 bit raw data to 24bit bitmap image
    By bibhukalyana in forum Qt Programming
    Replies: 1
    Last Post: 25th September 2011, 18:58
  3. Replies: 1
    Last Post: 4th August 2010, 17:13
  4. Replies: 6
    Last Post: 16th July 2010, 11:07
  5. Replies: 2
    Last Post: 16th April 2008, 10:31

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.