I have a slider which uses a png of an LED within it. I have a button in the plugin which enables/disables the slider and accordingly have 2 pngs of the LED where it is either on/off.
The slider is drawn via the drawLinearSlider() function inside the LookAndFeel class but I can’t figure out how to dynamic change the png used for the slider?
If you enable/disable the slider with your button you can check its enabled state in your LookAndFeel method called calling
slider.isEnabled()
Then pick your image accordingly. You can also set properties for your slider object, which you can also pick up in your LookAndFeel class. So if you wanted to set the image when your button is called you could do something like this:
Maybe I misunderstood you, but if your slider has only two states, it sounds you actually wanted to use an ImageButton.
Just enable setClickingTogglesState() or similar. It is a common method for all button subclasses.