How use 32bit bitmap for menus in Win32 app

drjackool 956 Reputation points
2023-09-05T16:52:26.82+00:00

Hi

Platform: Win32

How set 32bit (alpha channel) bitmap for menus? When I loading the bitmap by Loadbitmap or LoadImage with LR_CREATEDIBSECTION the alpha channel in the bitmap painted as white color and it is not transparent? Is there a way to fix it? Or I have to use my old owner draw menu method!

Thanks

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,413 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Castorix31 81,356 Reputation points
    2023-09-05T21:16:41.25+00:00

    A way is with WIC

    I tested the WICCreate32BitsPerPixelHBITMAP function (from MS) I had posted in this thread : https://learn.microsoft.com/en-us/answers/questions/642735/how-to-make-a-bitmap-with-alpha-using-transparentb

    with a 32-bit BMP with Alpha channel in a menu item and it is transparent :

    BMP_Alpha

    1 person found this answer helpful.
    0 comments No comments

  2. drjackool 956 Reputation points
    2023-09-06T06:13:45.3+00:00

    Problem solved by using Pre-multiplied alpha channel.

    0 comments No comments