Results 1 to 20 of 21

Thread: Problems working with 8bpp and 24bpp images

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    21
    Thanked 418 Times in 411 Posts

    Default Re: Problems working with 8bpp and 24bpp images

    you will have to add an if statment and see if the painting is for 24 or 8bpp.
    If the 24bpp then use the code you have, if its 8bpp, you have only 255 possible colors, so you will have to deal with that somewhere in your probgram, i.e limmiting the users to choose a color only from the 255 you use.

  2. #2
    Join Date
    Jan 2006
    Location
    Catalonia
    Posts
    266
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    44
    Thanked 2 Times in 2 Posts

    Default Re: Problems working with 8bpp and 24bpp images

    Quote Originally Posted by high_flyer
    ... if its 8bpp, you have only 255 possible colors, so you will have to deal with that somewhere in your probgram, i.e limmiting the users to choose a color only from the 255 you use.
    Exactly, the problem is that with the code that I have posted, although I pass it a valid color from the 255 (in my case a greyscale), it dosen't works

  3. #3
    Join Date
    Jan 2006
    Location
    Catalonia
    Posts
    266
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    44
    Thanked 2 Times in 2 Posts

    Default Re: Problems working with 8bpp and 24bpp images

    Anybody knows how could I modify the code above to support 8bpp images?

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    21
    Thanked 418 Times in 411 Posts

    Default Re: Problems working with 8bpp and 24bpp images

    Quote Originally Posted by SkripT
    Anybody knows how could I modify the code above to support 8bpp images?
    I answered you, do you expect code?
    You should think a bit your self...
    In a case of gray scale you should use qGray().

  5. #5
    Join Date
    Jan 2006
    Location
    Catalonia
    Posts
    266
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    44
    Thanked 2 Times in 2 Posts

    Default Re: Problems working with 8bpp and 24bpp images

    Quote Originally Posted by high_flyer
    ... if its 8bpp, you have only 255 possible colors, so you will have to deal with that somewhere in your probgram, i.e limmiting the users to choose a color only from the 255 you use.
    Sorry high flyer I didn't undestand what you meant. Thanks.

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.