Image to Drawable


#1

Hi,

I wanted to use an image in a DrawableButton but I'm a little confused on how images and drawables are supposed to relate.  I assumed I could use images for the "setImages" function (inside DrawableButton) but it requires drawables and those don't seem to be implicitly available from images.

 


#2

https://github.com/julianstorer/JUCE/blob/master/examples/Demo/Source/Demos/WidgetsDemo.cpp 

See ButtonsPage()


#3

Thanks.  The link you pasted gets a 404, for some reason.  In case anyone else needs it:

https://github.com/julianstorer/JUCE/blob/master/examples/Demo/Source/Demos/WidgetsDemo.cpp

 

And the short answer is that you need to create a DrawableImage to do the conversion.

DrawableImage convert;
convert.setImage(ImageCache::...);