From 3592c02b7f5a6b87337902b1567e598cf6ff0726 Mon Sep 17 00:00:00 2001 From: Victor Date: Tue, 18 Jun 2019 16:35:06 +0900 Subject: [PATCH] Fix misdraw when image color type is palette and overlay is RGBA --- .../akaita/android/easylauncher/plugin/EasyLauncher.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugin/src/main/groovy/com/akaita/android/easylauncher/plugin/EasyLauncher.java b/plugin/src/main/groovy/com/akaita/android/easylauncher/plugin/EasyLauncher.java index 1fa9f96..c8e4c26 100644 --- a/plugin/src/main/groovy/com/akaita/android/easylauncher/plugin/EasyLauncher.java +++ b/plugin/src/main/groovy/com/akaita/android/easylauncher/plugin/EasyLauncher.java @@ -1,6 +1,7 @@ package com.akaita.android.easylauncher.plugin; +import java.awt.*; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; @@ -22,7 +23,11 @@ public EasyLauncher(File inputFile, File outputFile) throws IOException { this.inputFile = inputFile; this.outputFile = outputFile; - image = ImageIO.read(inputFile); + BufferedImage readImage = ImageIO.read(inputFile); + image = new BufferedImage(readImage.getWidth(), readImage.getHeight(), BufferedImage.TYPE_INT_ARGB); + Graphics2D g2d = image.createGraphics(); + g2d.drawImage(readImage, 0, 0, null); + g2d.dispose(); } public void save() throws IOException {