It’s probably just the wrong scale. E.g. if your SVG is a page with a small picture in the middle, that entire page will be shrunk to fit in the button, so the image might be too small to see.
[quote=“toshi”]
Jucer’s code’s imageButton->setImages has 12 parameters, but
Juce_amalgamated.h line 43765 has 13 parameters. (float hitTestAlphaThreshold = 0.0f)[/quote]
Did you use the pre-built binary of the Jucer from git? The last time I checked it, it was not up-to date and the generated code for ImageButtons didn’t build with the most recent juce sources. After building the jucer project myself everything worked fine.
Old thread, but I’m having the same problem in tip version. Is ImageButton class supposed to be able to load .SVG data?
If I create a resource from a .PNG file, it works fine both as Drawable and as ImageButton, but if I create a resource from an .SVG file, it only works as Drawable, not with ImageButton (although Jucer seems to suggest it should work).
I guess some glue is needed to make SVG work with ImageButtons?
Add an imagebutton to the gui editor, set the normal image to a svg file by using -- create new image resource -- and selecting the file, nothing shows up in the button.
Export the svg as png in a 3dparty app, set the png as the image, displays fine.
Set the svg as the image of a image component, displays fine.
But I can´t add a DrawableButton in the introducer (or?) so in that case this whole topic is pointless.
I´ll just add the drawables as Generic in introducer, and add the image loading in "manual" code.
So, my very late christmas-wish-list would be:
Possible to add a DrawableButton, just like a ImageButton in the introducer.
And make it possible for the ImageButton and DrawableButton to use images from the binary resources in the project, not only images emedded in the component.