In this extremely quick tutorial we will learn how can we create a transparent Window in REALbasic on Mac OS. Watch it, learn it, enjoy it!
To make our Window transparent simply go to the code editor then to Event Handlers Sub Open () and use this function declare. And this way we will have a nice looking transparent Window1 on our Mac OS.
1 2 3 | Declare Function SetWindowAlpha Lib "Carbon" (inWindow As WindowPtr, inAlpha As single) as integer call SetWindowAlpha(Window1, .67) // (name of window, percent of visibility) |
On Windows you can try to use something like this:
Dim i As Integer = 255 * alpha
Declare Sub SetLayeredWindowAttributes Lib “user32″ (hwnd As Integer, thecolor As Integer, bAlpha As integer, alpha As Integer)
SetLayeredWindowAttributes(w.WinHWND, 0 , i, LWA_ALPHA)
Does this work for windows too?
Ricky you must check it. I don’t have now a REALbasic for Windows, my trial version expired.
Also you can find example of window transparency for Mac/Windows in RealBasic examples folder Examples/Declares/External Methods.rbp.
Thx for tip Vit!