1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-06 04:00:08 +00:00

Projucer: Draw transparent iOS app icons onto a white background so that they are valid

This commit is contained in:
ed 2017-12-11 11:22:33 +00:00
parent a1b9900bae
commit ad0e97fef4

View file

@ -2111,6 +2111,18 @@ private:
{
auto image = rescaleImageForIcon (*images.getFirst(), type.size);
if (image.hasAlphaChannel())
{
Image background (Image::RGB, image.getWidth(), image.getHeight(), false);
Graphics g (background);
g.fillAll (Colours::white);
g.drawImageWithin (image, 0, 0, image.getWidth(), image.getHeight(),
RectanglePlacement::centred | RectanglePlacement::onlyReduceInSize);
image = background;
}
MemoryOutputStream pngData;
PNGImageFormat pngFormat;
pngFormat.writeImageToStream (image, pngData);