Picture Control Order

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
TheDewd
Posts: 1513
Joined: 19 Dec 2013, 11:16
Location: USA

Picture Control Order

29 Aug 2022, 12:27

I'm attempting to layer Picture controls.

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
Attachments
image.png
image.png (403 Bytes) Viewed 505 times
wetware05
Posts: 750
Joined: 04 Dec 2020, 16:09

Re: Picture Control Order

29 Aug 2022, 15:38

TheDewd, why try to change the order of the layers and not just adapt to how autohotkey works? The first layer of the gui, the one that will read or interpret autohotkey first, will be the one that is furthest to the bottom.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: just me, Rohwedder, Spawnova and 110 guests