First, I add a Picture control with a specific background color, then I add another Picture control containing an image with transparent background -- however the z-order is not what I was expecting and this will not work.
I don't understand why I have to add the Picture controls in reverse order. The Picture control responsible for background color must be added AFTER the Picture control which is loading the picture file.
If I add the control for background color first, it ends up at the top-most layer which covers up the picture from the image file.
I hope that makes sense.
I learned that I can change the order using a command, but I'd like to understand more about why this happens.
WinSet, Bottom,, % "ahk_id" hNavbarBg
Code: Select all
hBM2D2E31 := DllCall("Gdi32.dll\CreateBitmap", "Int", 1, "Int", 1, "Int", 0x1, "Int", 32, "Ptr*", 0x2D2E31, "Ptr")
Gui, Add, Picture, x0 y0 w48 h48 +BackgroundTrans, img/baseline_menu_white_24dp.png
Gui, Add, Picture, x0 y0 w640 h48 +HWNDhNavbarBg, % "HBITMAP:* " hBM2D2E31