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:
parent
a1b9900bae
commit
ad0e97fef4
1 changed files with 12 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue