CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2010
    Posts
    47

    [RESOLVED] 8bpp bmps

    Hi there, I've been trying to manipulate 8bpp images stored in a CBitmap. From what I've read the problem is that the 8bpp bmps use a format that's different from what I've been using... up until now I've just been reading the bytes (or bits) and mapping that to RGB values.

    Apparently 8bpp uses color tables, and the byte tells you which entry in the color table I should be looking at. Unfortunately I haven't been able to dig up how to find the color table that the bitmap I just loaded is going to use.

    So, given that I load a bitmap with code like:
    Code:
    HBITMAP hBMP = (HBITMAP) LoadImage( NULL, filename, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_CREATEDIBSECTION | LR_VGACOLOR);
    and that I happen to know that it's an 8bpp file, know how to read it's BITMAPINFO and such, how do I know what a particular byte in an 8bpp bitmap means? How do I find this color table that I've seen mentioned?

  2. #2
    Join Date
    Aug 2010
    Posts
    47

    Re: 8bpp bmps

    Well. I feel kinda dumb. Turns out it was simply bmiColors in BITMAPINFO.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured