I have a strange Problem in my plugin. I have two images for my Background (same Image one of them is a copy of the other which is just desaturate.
So i have a simple bool variable, in my paint function i check this variable. If it’s true paint Image A if not paint Image B. Pretty simple.
So but now here is my problem.
If the value is changed, the background is not repainted complete. So behind my component’s (slider and buttons) i can see the other background everywhere else is the old image.
If i move the plugin window outside the monitor and back the Plugin is total repaint and looks good.
So this is what i tried:
Detect that the value was toggled, if yes make a g.fillAll(Colours::white);
Detect that the value was toggled, if yes make a Clear Image and paint it first
g.setColour(Colours::yellow.withAlpha((uint8)128)); const int width = getWidth(); const int height = getHeight(); g.drawRect(0, 0, width, height); Image image(Image::ARGB, 500 , 200, true); image.clear(image.getBounds(), Colours::red.withAlpha(uint8(64))); image.clear((image.getBounds() / 2).translated(30, 30)); g.setOpacity(1.0f); g.drawImageAt(image, 10, 10);
- Detect that the value was toggled, if yes paint only the new background Image and after that return.
Everything was looking the same (behind the components i have the new image) the rest of the plugin has the old Image.
Has anyone a idea how i can make a “clear” repaint or something like that?
Thank you and best wishes