I'm looking for a way to add a CanvasGadget with a transparent background to a transparent window. I want to make something like a ruler. I am using the code from this page. Is it possible? Maybe someone has a better idea? It's not important for me to use CanvasGadget. I chose it because it supports transparency. I could use an ImageGadget, but the window size can change. And I need to adjust to the new window size. It should just be a stripe, let's say a greenish color, through which the contents of other windows that are currently under my window will shine through. The StatusBar looks perfect, but it's hard to adapt it to my conditions. I think so.
Okay. How to do it with this code?
Code: Select all
OpenWindow(0, 0, 0, 400, 200, "Select your area", #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_ScreenCentered|#PB_Window_Tool)
SetWindowColor(0, #Blue)
SetWindowLong_(WindowID(0), #GWL_EXSTYLE, #WS_EX_LAYERED|#WS_EX_TOPMOST)
SetLayeredWindowAttributes_(WindowID(0), #Blue, 0, #LWA_COLORKEY)
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindowThanks in advance for your advice and replies.



