A Aysic4Bandroid Member Licensed User Longtime User Jun 30, 2012 #1 hi, Please can anyone put be right here - i want to load a different background image in a panel which is set 100% wide and high. I'm testing on three specific devices: 3.5 inch phone, and 7 and 10.1 inch tablets and landscape and portrait variations for each How can i achieve this with the designer scripts feature (i'm currently getting an error when trying to run this code in the variant-specific script block for my 7", landscape variant: Code: Copy 'Variant specific script: 800x480,scale=1 pnlBackdrop.SetBackgroundImage(LoadBitmap(File.DirAssets,"appbg_L7.png")) The error reads: Code: Copy Compiling code. 0.01 Compiling layouts code. Error The given key was not present in the dictionary. Error File: kwzmka_main.bal Go to the designer script page to debug this error. Have i misunderstood the scope of what can be achieved in the designer scripts tab - if i do it in the editor with conditional statements is this the correct way? Many Thanks
hi, Please can anyone put be right here - i want to load a different background image in a panel which is set 100% wide and high. I'm testing on three specific devices: 3.5 inch phone, and 7 and 10.1 inch tablets and landscape and portrait variations for each How can i achieve this with the designer scripts feature (i'm currently getting an error when trying to run this code in the variant-specific script block for my 7", landscape variant: Code: Copy 'Variant specific script: 800x480,scale=1 pnlBackdrop.SetBackgroundImage(LoadBitmap(File.DirAssets,"appbg_L7.png")) The error reads: Code: Copy Compiling code. 0.01 Compiling layouts code. Error The given key was not present in the dictionary. Error File: kwzmka_main.bal Go to the designer script page to debug this error. Have i misunderstood the scope of what can be achieved in the designer scripts tab - if i do it in the editor with conditional statements is this the correct way? Many Thanks
NJDude Expert Licensed User Longtime User Jun 30, 2012 #2 You CANNOT do this on the designer scripts: Code: Copy pnlBackdrop.SetBackgroundImage(LoadBitmap(File.DirAssets,"appbg_L7.png")) You will have to do that on the activity You could use a code like THIS to achieve what you're looking for. Last edited: Jun 30, 2012 Upvote 0
You CANNOT do this on the designer scripts: Code: Copy pnlBackdrop.SetBackgroundImage(LoadBitmap(File.DirAssets,"appbg_L7.png")) You will have to do that on the activity You could use a code like THIS to achieve what you're looking for.
Erel B4X founder Staff member Licensed User Longtime User Jul 1, 2012 #3 You can add an ImageView on the Panel and then set ImageView.Image to set the image. This will allow you to set different images based on the variant. Upvote 0
You can add an ImageView on the Panel and then set ImageView.Image to set the image. This will allow you to set different images based on the variant.