Hi all can i make a sound button on my app using 2 images
1.jpg = on
2.jpg = off
how can i make to dont need loadbitmap all time again and again when user press
have a way to load this 2 images at activity create and later only change when button press or i realy need use loadbitmap all time?
Hi Douglas, you just need to create two global variables. Load the bitmaps to these and that's it. You don't need to load bitmap again, just call the global variables instead.
Dim Mygoback As Int : Mygoback = 1 ' = toggle
Dim btnchange As Button
-----------------------------------------------------------------
Sub btnchange_Click
Select Mygoback
Case 1
btnchange.SetBackgroundImage(LoadBitmap(File.DirAssets, "go.png"))
Case 2
btnchange.SetBackgroundImage(LoadBitmap(File.DirAssets, "back.png"))
End Select
Mygoback = Mygoback + 1
If Mygoback > 2 Then
Mygoback = 1
End If
End Sub
load both images in activity create, then alternate their (visible) property of the two images. button image are very tiny so they will not consume much memory resources.