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

    How to translate colors from 32bits to 24bits??

    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



  2. #2
    Join Date
    Jul 1999
    Posts
    4

    Re: How to translate colors from 32bits to 24bits??

    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



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