Results 1 to 2 of 2

Thread: Qimage in RGB24

  1. #1
    Join Date
    Jan 2006
    Posts
    122
    Thanks
    16
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Qimage in RGB24

    Hi all,
    I'd like to load a bitmap file into a QImage but I'd like to have it in RGB24 format(in order to acces with bits() a buffer 0xRRGGBB), reading the documentation this format is not allowed, is there a way to do so?
    thanks in advance

  2. #2
    Join Date
    Jun 2006
    Posts
    11
    Thanked 4 Times in 4 Posts

    Default Re: Qimage in RGB24

    You'll probably have to use 32 bits, I'm not sure which byte is the alpha-channel but a quick test with an image of known values (ie. all red) should let you know. You can also use
    Qt Code:
    1. QRgb QImage::pixel ( int x, int y ) const
    To copy to clipboard, switch view to plain text mode 
    to get the values of a specific pixel

Similar Threads

  1. [Qt4] How to load Url image into QImage?
    By Gonzalez in forum Qt Programming
    Replies: 6
    Last Post: 13th October 2014, 10:10
  2. Diff between QImage, QPixmap, QPicture
    By nupul in forum Newbie
    Replies: 6
    Last Post: 30th April 2008, 02:02
  3. QImage from 8 bit char* RGB buffer
    By tboloo in forum Qt Programming
    Replies: 13
    Last Post: 15th April 2006, 19:56
  4. Replies: 3
    Last Post: 15th March 2006, 11:44
  5. Trouble with image painting (QPainter + QImage)
    By krivenok in forum Qt Programming
    Replies: 1
    Last Post: 4th February 2006, 20:25

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.