Using Graphics::setColour makes any calls to DrawableImage::drawAt(…) use the previously set alpha value in the graphics context. Maybe this is by design but it feels weird, seing as we normally use Graphics::beginTransparencyLayer() if we want to use alpha on something.
Small example where “testBitmap” is a fully opaque DrawableImage that produces this result:
https://postimg.org/image/svquwcg5b/
int xpos = 0, ypos = 0;
int w = 100, h = 25;
g.setColour(Colour::fromRGBA(20, 20, 20, 255));
testBitmap->drawAt(g, xpos, ypos, 1.f);
g.setColour(Colour::fromFloatRGBA(255, 255, 255, 0.8f));
g.drawText(“Hello”, xpos,ypos,w,h,Justification::left);ypos += h;
testBitmap->drawAt(g, xpos, ypos, 1.f);
g.setColour(Colour::fromFloatRGBA(255, 255, 255, 0.6f));
g.drawText(“Hello”, xpos, ypos, w, h, Justification::left);
ypos += h;
testBitmap->drawAt(g, xpos, ypos, 1.f);
g.setColour(Colour::fromFloatRGBA(255, 255, 255, 0.4f));
g.drawText(“Hello”, xpos, ypos, w, h, Justification::left);
ypos += h;
testBitmap->drawAt(g, xpos, ypos, 1.f);
g.setColour(Colour::fromFloatRGBA(255, 255, 255, 0.2f));
g.drawText(“Hello”, xpos, ypos, w, h, Justification::left);
I would expect a colour set to draw something in the context to not be used when drawing images, since well, the colour is not actually used but in this case the alpha channel from the colour is still used.
If I want a active alpha channel for my images i would normally use begin and end transparency layer.