Results 1 to 4 of 4

Thread: How to get colored QImage

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: How to get colored QImage

    qRgb ( i,i,i ) will always be gray!

  2. #2
    Join Date
    May 2011
    Posts
    239
    Thanks
    4
    Thanked 35 Times in 35 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Symbian S60

    Default Re: How to get colored QImage

    And of course the colour map needs to be created _before_ conversion and passed as an argument to the conversion. How else would Qt know to what index to map each RGB pixel using a closest match principle.

    So, you need to get a ready-made colour map data from somewhere...

  3. #3
    Join Date
    Aug 2012
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to get colored QImage

    Okay.....you`re right.....but how to do it otherwise.....do i have to build a loop for each Rgb value......means instead of i,i,i, to use i for red, j for green and k for blue??? Is it right to use QRgb? Did I have to use a Vector or does QT have another possibility???
    And why do I get the black and white Stripes when I use: image = QImage(600, 453, QImage::Format_Indexed8???

    Would be very nice if someone can help a little bit more. I`m not a Guru but it`ll be nice to get one in a few years :-p ....greetz Nadja

Similar Threads

  1. Replies: 1
    Last Post: 9th August 2010, 19:44
  2. Write colored text
    By wirasto in forum Qt Programming
    Replies: 1
    Last Post: 14th June 2010, 12:55
  3. Two-colored cell in item view
    By UVV in forum Qt Programming
    Replies: 1
    Last Post: 3rd September 2009, 16:33
  4. Colored cursor
    By maverick_pol in forum Qt Programming
    Replies: 4
    Last Post: 15th May 2008, 12:16
  5. Colored Buttons
    By Walsi in forum Newbie
    Replies: 33
    Last Post: 8th December 2007, 12:58

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.