With the JUCE UI system how do you set the background as an image instead of a solid colour?

Hi there,

I know that you can set a button up and then make it not clickable but that is obviously not the correct way to do it so if anyone has the correct method that would be great!

Thanks for your time!

I think you’re looking for Juce::ImageComponent

Having said that, what you should probably be doing is drawing your background using vectors & gradients.


Image bgImg = ImageFileFormat::loadFrom (BinaryData::bg_png, BinaryData::bg_pngSize);

void MainContentComponent::paint(Graphics& g)
    g.setTiledImageFill (bgImg, 0, 0, 1.0f);