B4J Question [SOLVED][B4X][B4J] SplashScreen problem Transparent

Discussion in 'B4J Questions' started by GMan, Apr 18, 2019.

  1. GMan

    GMan Well-Known Member Licensed User

    i am using @Erel 's code for displaying a splashscreen with a transparent logo and an transparent screen:

    Code:
    Sub ShowSplashScreen
       
    Dim sp As Form
       sp.Initialize(
    "sp"600600)
       sp.SetFormStyle(
    "TRANSPARENT")
       sp.BackColor = fx.Colors.Transparent
       
    'change image here
       CSSUtils.SetBackgroundImage(sp.RootPane, File.DirAssets, "aLogo.png")
       sp.Show
       sp.RootPane.Alpha = 
    0
       sp.RootPane.SetAlphaAnimated(
    5001)
       
    Wait For (sp.RootPane) sp_AnimationCompleted
       Sleep(
    3000)
       sp.RootPane.SetAlphaAnimated(
    10000)
       
    Wait For (sp.RootPane) sp_AnimationCompleted
       sp.Close
       CallSubDelayed(Me, 
    "Splash_Complete")
    End Sub
    Allw works fine, but the screen isn't transparent - the .png is !
    Code:
    sp.SetFormStyle("TRANSPARENT")
       sp.BackColor = fx.Colors.Transparent
    and
    Code:
    sp.RootPane.Alpha = 0
    The Sample code works fine !

    I am always using paint.net to make pics transparent
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Please upload a small project with this code and image.
     
  3. GMan

    GMan Well-Known Member Licensed User

    SOLVED - i hadn't placed the part

    Code:
    Sub AppStart (Form1 As Form, Args() As String)
        
    ' Programmfenster anzeigen
        MainForm = Form1
        ShowSplashScreen
        
    Wait For Splash_Complete
        MainForm.RootPane.LoadLayout(
    "Layout1")
        MainForm.SetFormStyle(
    "UNIFIED")
    NOT at the very beginning of AppStart and initialized some non-Designer objects first: then it will not work and the background colored (here gray)

    When placing dirctly behind AppStart all works fine
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice