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.
https://github.com/julianstorer/JUCE/blob/master/examples/Demo/Source/Demos/WidgetsDemo.cpp
See ButtonsPage()
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::...);
I guess that is a up-to-date link:
/*
==============================================================================
This file is part of the JUCE examples.
Copyright (c) 2017 - ROLI Ltd.
The code included in this file is provided under the terms of the ISC license
http://www.isc.org/downloads/software-support-policy/isc-license. Permission
To use, copy, modify, and/or distribute this software for any purpose with or
without fee is hereby granted provided that the above copyright notice and
this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES,
WHETHER EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR
PURPOSE, ARE DISCLAIMED.
==============================================================================
*/
/*******************************************************************************
This file has been truncated. show original