Is it possible to use a clipping mask when drawing an Image?


#1

I don’t know if I might be doing something wrong, but it seems that when I try to draw an image, JUCE ignores any previous calls to reduceClipRegion and just draws the full image. Am I doing something wrong?


#2

Can you post some code? The following is working for me:

void paint (Graphics& g) override
{
    g.reduceClipRegion (getLocalBounds().reduced (100));
    g.drawImage (image, getLocalBounds().toFloat());
}

#3

Actually the problem was with reducing clip region by path, but I realise that the problem was just caused by an error on my part. Thanks.