I have an image which represents a dial from x value to y value where the first part of the image is x and the last part of the image is y ..
What i want to do is by pressing an up or down button only the image part representing that setting must be displayed in a panel..
I think it has to to with sprites but I am not familiar on how it works..
Can any body please help..It would be much appreciated..
I use JKnobman to create different dials and sliders for my projects..
I prefer to use it..
Makes the interface looks better..
I can split the image it into different single images.. BUT..
I would prefer to move the single image into position according to the value needed as per the image..
Dim original As B4XBitmap = xui.LoadBitmap(...)
Dim images As List
images.Initialize
For i = 0 to 20
images.Add(original.Crop(0, i * SpriteHeight, original.Width, SpriteHeight)
Next
@werner_Fourie I think i believe you can follow @Erel's suggestion without giving up the image made with JKnobman.
I would put the JKnobman image in an ImageView and above a CustomView with a transparent background that realizes the green bar and the percentage number.
However, the image created with JKnobman can also be created from code
I used to use JKnobman in Windows programming. Usually you load the whole knob image and copy part of the image into your view. B4A Canvas.DrawBitmap does support SrcRect and DestRect, I believe you can just use it.