I've tried my hands at creating something like this. If you haven't used photoshop and don't understand what's happening from looking at the pictures I'll try to explain it:
There are 3 sliders. Red, green and blue, all of them have a gradient applied to them from Color(0, 0, 0) to COlor(red, green, blue). They also each control the value of their color, so I want the slider to function as a slider would and simply change the background image in real-time.
Here's what I tried (with horrible results)
Horrible as in it freezes. The documentation told me that Apply() is expensive but I don't know how else I'd go about doing this.
Any ideas? Here's the slider code in case you'd like to know:
I made a gif just to clarify: http://i.imgur.com/LshWC.gif
Edit: I also fixed the broken code... Sorry for the confusion
Christ now I feel stupid... I changed it to go between 0 and 1 instead. I'm used to XNA and they used 0-255. The crashing also came from me using the wrong format. I changed it to ARGB 32 bit and it worked.
answered Aug 19 '12 at 05:13 PM