What’s the best way to create a stencil component in JUCE such that the component has an opaque background and anything drawn is displayed as transparent “holes” through which any content behind the component is shown. Like a stencil.
I tried something like the following:
Image image(Image::ARGB, w, h, false); Graphics g(image); g.fillAll(Colours::red); g.setColour(Colours::white); drawStuff(g); DrawableImage drawable; drawable.setImage(image); drawable.replaceColour(Colours::white, Colours::transparentBlack);
- the replaceColour() doesn’t work
- presumably even if it did work, I’d just end up with a red background and not a stencil of elements drawn with drawStuff()
So I’m guessing this is the wrong approach…