T Tata Mapassa Member Licensed User Longtime User Aug 23, 2022 #1 Hello, I have 4 images and I want an image to appear randomly on the background of the layout when opening the application.
Hello, I have 4 images and I want an image to appear randomly on the background of the layout when opening the application.
Alexander Stolte Expert Licensed User Longtime User Aug 23, 2022 #2 GOMBE said: I have 4 images Click to expand... Nice, i have 4 images too. Where do you have them? In the Assets folder, on your server, in a list, in another folder on the system? Upvote 0
GOMBE said: I have 4 images Click to expand... Nice, i have 4 images too. Where do you have them? In the Assets folder, on your server, in a list, in another folder on the system?
DonManfred Expert Licensed User Longtime User Aug 23, 2022 #4 B4X: Dim random As Int = Rnd(1,5) Upvote 0
T Tata Mapassa Member Licensed User Longtime User Aug 23, 2022 #5 i found this n = Rnd(1, 4) ' in your case between 1 and 3 ImageView1.Bitmap = LoadBitmap(File.DirAssets, "Image_" & NumberFormat(n, 2, 0) & ".png") Thank you Upvote 0
i found this n = Rnd(1, 4) ' in your case between 1 and 3 ImageView1.Bitmap = LoadBitmap(File.DirAssets, "Image_" & NumberFormat(n, 2, 0) & ".png") Thank you
Alexander Stolte Expert Licensed User Longtime User Aug 23, 2022 #6 B4X: Dim MyFinalBackgroundImage As B4XBitmap = xui.LoadBitmap(File.DirAssets,"MyImage_" & Rnd(1,5) & ".png") Upvote 1
B4X: Dim MyFinalBackgroundImage As B4XBitmap = xui.LoadBitmap(File.DirAssets,"MyImage_" & Rnd(1,5) & ".png")