Hi, i’m very new on JUCE (in fact, this is my first time), and not an c++ expert, i just clicked the “GUI” template on JUCE and began testing some options.
I saw people create a ImageComponent to add image, but i’m not sure that i want to create components for all images i want to add, so i tried to draw the image directly by the “paint” function, the code is like this:
void MainComponent::paint (juce::Graphics& g)
Image FlowerIMG = ImageCache::getFromFile(Flower);
//Image FlowerIMG = ImageFileFormat::loadFrom(Flower);
Colour Pink(255, 0, 127);
g.drawText(“Hello World!”, getLocalBounds(), Justification::centred, true);
g.drawImageAt(FlowerIMG, 10, 10, 0);
As you can see, i’m just figuring things out in the “hello world” template.
The code compiles successfully, but the screen don’t draws my beautiful flower.
Should i use ImageComponent?
Maybe this code makes no sense, as i said, i’m kinda new in c++…