Using images for background of component [SOLVED]


I have a simple question: how can I use images (for example for background of component).
Thanks for reply


Where you have a class member

Image    m_Background;

Load the image in the class constructor, then in paint():

void CYourComponent::paint (Graphics& g)
    if (m_Background.isValid())
        g.drawImageAt (m_Background, 0, 0);




Yes I know, but I do not know how to load an image (for example png) to Image class.


static Image ImageCache::getFromFile (const File & file)



Thanks for your reply, I found what I need.

Image splash = ImageFileFormat::loadFrom(BinaryData::splashscreen_png, (size_t) BinaryData::splashscreen_pngSize);

I apologize for the confusion