W werner_Fourie Member Licensed User Longtime User Oct 19, 2020 #1 Hi All.. 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.. Thanks.. Attachments PROONE2.png 20.7 KB · Views: 359
Hi All.. 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.. Thanks..
Erel B4X founder Staff member Licensed User Longtime User Oct 19, 2020 #2 Why not use https://www.b4x.com/android/forum/t...ogress-bar-with-gradient-fill.104476/#content ? Upvote 0
W werner_Fourie Member Licensed User Longtime User Oct 19, 2020 #3 Erel said: Why not use https://www.b4x.com/android/forum/t...ogress-bar-with-gradient-fill.104476/#content ? Click to expand... Hi Erel 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.. Still pray for some help.. Thanks anyway.. Upvote 0
Erel said: Why not use https://www.b4x.com/android/forum/t...ogress-bar-with-gradient-fill.104476/#content ? Click to expand... Hi Erel 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.. Still pray for some help.. Thanks anyway..
W werner_Fourie Member Licensed User Longtime User Oct 19, 2020 #4 Just a small comment on what the image is.. It is used as a dial on the screen where an operator dials in a preset .. Upvote 0
Just a small comment on what the image is.. It is used as a dial on the screen where an operator dials in a preset ..
Erel B4X founder Staff member Licensed User Longtime User Oct 19, 2020 #5 Something like: Code: 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 Later you can get an image with: Code: Dim b As B4XBitmap = images.Get(13) Upvote 0
Something like: Code: 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 Later you can get an image with: Code: Dim b As B4XBitmap = images.Get(13)
Star-Dust Expert Licensed User Longtime User Oct 19, 2020 #6 Erel said: Why not use https://www.b4x.com/android/forum/t...ogress-bar-with-gradient-fill.104476/#content ? Click to expand... @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 Upvote 0
Erel said: Why not use https://www.b4x.com/android/forum/t...ogress-bar-with-gradient-fill.104476/#content ? Click to expand... @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
kimstudio Active Member Licensed User Longtime User Oct 19, 2020 #7 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. Upvote 0
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.
W werner_Fourie Member Licensed User Longtime User Oct 20, 2020 #8 You are all stars.. Thank You for the input.. @Erel's suggestion worked.. thanks Upvote 0