I’ve spent hours trying to figure out what I’m doing wrong, and have looked at the demos but I just can’t figure it out. Most of what I’ve done was created by the GUI editor too, so it just confuses me further. I have created several image buttons, and when they are clicked, the background image should change. Strangely, those parts of the background image that can be seen through the transparent portions of the buttons are actually being redrawn (perhaps because the button is forced to redraw when the mouse hovers) but nothing else is.
I don’t know if it is relevant but I’m using Visual Studio 2015 on Windows 10.
void SynthAudioProcessorEditor::paint (Graphics& g)
{
//[UserPrePaint] Add your own custom painting code here…
//[/UserPrePaint]
g.fillAll (Colours::white);
//[UserPaint] Add your own custom painting code here..
g.setColour(Colours::black);
switch (currentTab) {
case Overview:
g.drawImage(cachedImage_greyBarA_png_1, 5, 5, 790, 74, 0, 0, cachedImage_greyBarA_png_1.getWidth(), cachedImage_greyBarA_png_1.getHeight());
break;
case Tone:
g.drawImage(cachedImage_greyBarB_png_1, 5, 5, 790, 74, 0, 0, cachedImage_greyBarB_png_1.getWidth(), cachedImage_greyBarB_png_1.getHeight());
break;
case Modulation:
g.drawImage(cachedImage_greyBarC_png_1, 5, 5, 790, 74, 0, 0, cachedImage_greyBarC_png_1.getWidth(), cachedImage_greyBarC_png_1.getHeight());
break;
case Options:
g.drawImage(cachedImage_greyBarD_png_1, 5, 5, 790, 74, 0, 0, cachedImage_greyBarD_png_1.getWidth(), cachedImage_greyBarD_png_1.getHeight());
break;
}
//[/UserPaint]
}