B billmoultrie Member Licensed User Longtime User Dec 20, 2015 #1 Hi I am trying to put a background image on the anchorpage. I use the following code. B4X: Sub AppStart (Form1 As Form, Args() As String) MainForm = Form1 MainForm.RootPane.LoadLayout("main") 'Load the layout file. MainForm.Resizable = True MainForm.WindowHeight = 650 MainForm.WindowWidth = 800 Version = "Ver 2.5" MainForm.Title="CapConn "&Version MainForm.RootPane.Style = "-fx-background-image:url('" & File.GetUri(File.DirAssets, "rain.jpg") & "');" MainForm.Show If I run this in debug it works every time. If I run it in release it says 'Asset rain.jpg not found'. Any ideas?
Hi I am trying to put a background image on the anchorpage. I use the following code. B4X: Sub AppStart (Form1 As Form, Args() As String) MainForm = Form1 MainForm.RootPane.LoadLayout("main") 'Load the layout file. MainForm.Resizable = True MainForm.WindowHeight = 650 MainForm.WindowWidth = 800 Version = "Ver 2.5" MainForm.Title="CapConn "&Version MainForm.RootPane.Style = "-fx-background-image:url('" & File.GetUri(File.DirAssets, "rain.jpg") & "');" MainForm.Show If I run this in debug it works every time. If I run it in release it says 'Asset rain.jpg not found'. Any ideas?
stevel05 Expert Licensed User Longtime User Dec 20, 2015 #2 If you are using the Visual designer, you can add the background image there. Add the image to the Files List (Tools/Files in the visual designer) then select Background BitmapDrawable and select the Image file. Works in Debug and Release. Your code also works for me , but the image doesn't automatically get scaled Last edited: Dec 20, 2015 Upvote 0
If you are using the Visual designer, you can add the background image there. Add the image to the Files List (Tools/Files in the visual designer) then select Background BitmapDrawable and select the Image file. Works in Debug and Release. Your code also works for me , but the image doesn't automatically get scaled