I have a DrawableButton whose style is DrawableButton::ImageRaw
Its Image is from an image in cache. I noticed it looked quite blurry compared to the original so I ran a little test
On the left I just drew into the component the same image in the paint() method of the contentComponent. On the right is the DrawableButton… You can see its quite blurry in comparison
g.drawImageAt(ImageCache::getFromMemory(toolbargraphics::lock_png,toolbargraphics::lock_pngSize), 250, 0);
In DrawableImage I made the following little test
[code]
void DrawableImage::draw (Graphics& g, const AffineTransform& transform) const
{
if (image != 0)
{
const Colour oldColour (g.getCurrentColour()); // save this so we can restore it later
if (opacity > 0.0f && ! overlayColour.isOpaque())
{
g.setColour (oldColour.withMultipliedAlpha (opacity));
#if 1
g.drawImageAt(image, 0, 0);
#else
g.drawImageTransformed (image,
0, 0, image->getWidth(), image->getHeight(),
transform, false);
#endif
}[/code]
The result now looks like
Quite the differerence
I am getting called this from DrawableButton::paintButton()
if (style == ImageRaw)
{
imageToDraw->draw (g);
}
In my debugger I see the transform parameters are…
mat00 (1.0f)
mat01 (0)
mat02 (0)
mat10 (0)
mat11 (1.0f)
mat12 (0)
I’m hoping some optimization to drawImageTransformed can be made to make this look better!
Tnx