diff --git a/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/decoder/Res9patchStreamDecoder.java b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/decoder/Res9patchStreamDecoder.java index 22b0dd8f..9ce1be8a 100644 --- a/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/decoder/Res9patchStreamDecoder.java +++ b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/decoder/Res9patchStreamDecoder.java @@ -39,10 +39,9 @@ public class Res9patchStreamDecoder implements ResStreamDecoder { BufferedImage im = ImageIO.read(new ByteArrayInputStream(data)); int w = im.getWidth(), h = im.getHeight(); - ImageTypeSpecifier its = ImageTypeSpecifier.createFromRenderedImage( im ); - BufferedImage im2 = its.createBufferedImage( w+2, h+2 ); + BufferedImage im2 = new BufferedImage(w+2, h+2, BufferedImage.TYPE_INT_ARGB); + im2.createGraphics().drawImage(im, 1, 1, w, h, null); - im2.getRaster().setRect(1, 1, im.getRaster()); NinePatch np = getNinePatch(data); drawHLine(im2, h + 1, np.padLeft + 1, w - np.padRight); drawVLine(im2, w + 1, np.padTop + 1, h - np.padBottom); @@ -139,4 +138,4 @@ public class Res9patchStreamDecoder implements ResStreamDecoder { yDivs); } } -} \ No newline at end of file +}