Click to See Complete Forum and Search --> : How to translate colors from 32bits to 24bits??


Jason Hsu
July 5th, 1999, 03:51 AM
Can someone tell me how to translate colors from 32bits to 24bits?
I had loaded a bmp file to a HDC was 32bits then I wanna to write it to a JPEG file.
but the source bmp was a 32bits , so can not write to JPEG 24bits colors.
Is there someone know how??

Thanks in advance..

Jason Hsu

Kombat
July 6th, 1999, 06:51 PM
32 is basically 24 with an extra alpha channel

so if you had a 32bit value of

0xaarrggbb

just do (new_val = (old_val << 8);

thats it