|
-
November 3rd, 2010, 02:56 PM
#1
[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?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|