Results 1 to 5 of 5

Thread: color table for qimage

Hybrid View

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

    Default Re: color table for qimage

    what is the pixel depth of your bitmap?
    Qt can only handle 8 or 32 bpp (not talking about QTopia now).
    So if your bmp is not 8 bpp, then at best you will get a color distorded image (if anything) with your code.
    If your bmp is more than 8 bpp, then you wont be able to use the color table.
    At any rate, if your bmp is 8 bpp, you will have to use the 256 table, popluate the colors you are interested in, in the correct indexes, and the rest use 0 or something.
    But the table it self must be a 256 indexed table.
    Could you show the code where you initialize the bmp and QImage?

  2. #2
    Join Date
    Jan 2007
    Posts
    177
    Thanks
    8
    Thanked 10 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: color table for qimage

    i know now what's the really problem is.
    i extract the first bitmap from ntoskrnl.exe with

    HBITMAP bmp = LoadBitmap(ntoskrnl, MAKEINTRESOURCE(1));
    (ntoskrnl is an instance to ntoskrnl.exe)

    this HBITMAP should have only 16 colors, but somehow it has more, i can't update
    an new color table or palette. i've tried it with winapi, too but it doesn't take any effect.

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.