Hi everyone, I've the necessity to create a custom color picker that loos like this (made with Adobe XD).
Graphically speaking I've already done it using panels and an ImageView, based on this B4A example by @Erel concept, that is just what I needed.
Unfortunately I realized that there are two major problems porting this to B4i...
The red bar represent the one you see in the above screenshot (with all colors), the blue rectangle instead represent what it seems to "read" the .GetPixelColor function.
In fact if, I slide the finger on the bar it reads (wrong) colors, at a certain point it stops, and it can still reading colors even if you tap on the bar and then go down where the bar is not present...
SO, the question is:
Is there, today, a better way to achieve the same graphical result as shown? or any way actually?
Thanks in advance. I hope to have been clear...
Edit:
Here you are an example project
try to slide the finger on the colored bar... you can notice that a certain point beyond the green it can't go.. and also the color is totally wrong (respect where you tap)
Graphically speaking I've already done it using panels and an ImageView, based on this B4A example by @Erel concept, that is just what I needed.
Unfortunately I realized that there are two major problems porting this to B4i...
- In B4A the image is loaded in the panel itself, NOT an imageview, that does not have the _Touch event (but I think this can be fixed by putting an equal-sized panel on top of it)
- In B4i the Bitmap object does not have th .getPixel(x,y) method
... that one is true problem.
- Create an ImageView with the color spectrum
- Create a Panel on top of it with EXACT same sizes and location fo the imageview, in order to use the _Touch event of it, and get the coordinates to refer the pixel I want by the ImageView
- Use this snippet by @JanPRO to get the color from the ImageView using .GetBitmap
The red bar represent the one you see in the above screenshot (with all colors), the blue rectangle instead represent what it seems to "read" the .GetPixelColor function.
In fact if, I slide the finger on the bar it reads (wrong) colors, at a certain point it stops, and it can still reading colors even if you tap on the bar and then go down where the bar is not present...
SO, the question is:
Is there, today, a better way to achieve the same graphical result as shown? or any way actually?
Thanks in advance. I hope to have been clear...
Edit:
Here you are an example project
try to slide the finger on the colored bar... you can notice that a certain point beyond the green it can't go.. and also the color is totally wrong (respect where you tap)
Attachments
Last edited: