Browse Source

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

tags/2021-05-28
ed 7 years ago
parent
commit
ad0e97fef4
1 changed files with 12 additions and 0 deletions
  1. +12
    -0
      extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Xcode.h

+ 12
- 0
extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Xcode.h 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);


Loading…
Cancel
Save