Juce Audio Visualiser painting over itself

Hey all,

having an issue with the juce visualiser component where it will visually show the sample but then continually have that sample be pushed non stop, and then add all future samples above those painting the whole visualiser component red ( colour chosen )

this is the outcome from this issue:

i’m assuming i have missed some sort of function while setting up the visualiser.
has anyone had this issue before?

This burn-in effect is usually the result of a component with setOpaque(true) but then not filling the whole area. This will leave artefacts.

  • setOpaque (true): expects the paint() to fill every pixel
  • setOpaque (false): will fill the background by calling the parent’s paint() (potentially cascading up to the top-level component)

I assume that the component got confused setting the opaque flag internally from the background colour wrong.

1 Like

Thanks! with this line here,

audioProcessor.avc.setColours(Colours::transparentBlack.withAlpha(0.0f), Colours::lightblue.withAlpha(1.0f));

just commenting that out fixed it, is there a way you know of that would make the background part of the visualiser transparent, just keeping the visualisers buffer visible.

The solution is in the setOpaque. The setting of setOpaque defines, who is responsible for clearing the pixels.
Like explained in the previous post, if a component is setOpaque(false), it calls the parent to fill the pixels with the default background, in your case clearing the pixels from the previous visualiser paint.

In your hierarchy you have most likely a component that is marked opaque but doesn’t clear all pixels, e.g. by calling g.fillAll(colour);