LB Booster
« Transparent backgrounds »

Welcome Guest. Please Login or Register.
Apr 1st, 2018, 03:46am



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
We apologize Conforums does not have any export functions to migrate data.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

Thank you Conforums members.
Speed up Liberty BASIC programs by up to ten times!
Compile Liberty BASIC programs to compact, standalone executables!
Overcome many of Liberty BASIC's bugs and limitations!
LB Booster Resources
LB Booster documentation
LB Booster Home Page
LB Booster technical Wiki
Just BASIC forum
BBC BASIC Home Page
Liberty BASIC forum (the original)

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Transparent backgrounds  (Read 244 times)
Jack Kelly
Full Member
ImageImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 106
xx Transparent backgrounds
« Thread started on: Aug 16th, 2016, 07:35am »

Another question. Is there any way to make the background transparent for windows and/or controls. If so, it would make an easy job of placing a groupbox control in my visual designer program -- which I'm currently calling 'Freeform Lite'.
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: Transparent backgrounds
« Reply #1 on: Aug 16th, 2016, 08:31am »

on Aug 16th, 2016, 07:35am, Jack Kelly wrote:
Another question. Is there any way to make the background transparent for windows and/or controls.

Does this LBPE article help? The code there can be modified to make just the background transparent as follows:

Code:
    Nomainwin
 
    WindowWidth = 600
    WindowHeight = 400
    UpperLeftX = int((DisplayWidth-WindowWidth)/2)
    UpperLeftY = int((DisplayHeight-WindowHeight)/2)
    text$ = "This code was adapted from the Libby contest " + _
            "entry, LB Window Spier, by John Richardson.  " + _ 
            "It will NOT work on Windows 98 or Windows 95."
    Statictext #transp.txt1, text$, 20, 20, 550, 200
    Stylebits #transp, 0, 0, _WS_EX_LAYERED, 0
    Open "Transparent Window" for Window as #transp
    #transp, "Trapclose EndDemo"
    #transp, "Font Verdana 12 Bold" 
    hTransp = hWnd(#transp)
    Call SetTransparent hTransp
    Wait
 
Sub EndDemo handle$
    Close #handle$
    End
End Sub
 
Sub SetTransparent handle
    CallDLL #user32, "GetSysColor", 15 as Long, buttonface as Long
    CallDLL #user32, "SetLayeredWindowAttributes", _
        handle as Ulong, _
        buttonface as Long, _
        0 as Long, _
        _LWA_COLORKEY as Long, _
        layer as Long
End Sub 

For other options see this more comprehensive article.

Richard.
« Last Edit: Aug 16th, 2016, 08:59am by Richard Russell » User IP Logged

Jack Kelly
Full Member
ImageImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 106
xx Re: Transparent backgrounds
« Reply #2 on: Aug 17th, 2016, 07:09am »

Thanks, Richard, for your quick response to my question yesterday. I'll keep that in my 'bag of tricks'...
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls