From 537b2c10d30c88c10f3ac32a9f8d6069d1143b22 Mon Sep 17 00:00:00 2001 From: Bella Date: Fri, 21 Feb 2020 21:29:45 -0500 Subject: [PATCH] add temp method --- .../me/zeroeightsix/kami/util/WindowIcon.java | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/main/java/me/zeroeightsix/kami/util/WindowIcon.java b/src/main/java/me/zeroeightsix/kami/util/WindowIcon.java index 39af18ca..d2da2fbb 100644 --- a/src/main/java/me/zeroeightsix/kami/util/WindowIcon.java +++ b/src/main/java/me/zeroeightsix/kami/util/WindowIcon.java @@ -1,12 +1,15 @@ package me.zeroeightsix.kami.util; import javax.imageio.ImageIO; +import java.awt.*; import java.awt.image.BufferedImage; import java.awt.image.DataBufferByte; +import java.awt.image.WritableRaster; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; import java.nio.ByteBuffer; -import java.nio.ByteOrder; - -import static org.lwjgl.BufferUtils.*; +import java.util.Objects; /** @@ -28,5 +31,18 @@ public class WindowIcon { // return null; // } // } +/* + public static ByteBuffer[] extractBytes() throws IOException { + BufferedImage bufferedImage = ImageIO.read(new File("kami.jpg")); +// ByteArrayOutputStream bos = new ByteArrayOutputStream(); +// ImageIO.write(bufferedImage, "jpg", bos ); +// byte [] data = bos.toByteArray(); + + WritableRaster raster = bufferedImage.getRaster(); + DataBufferByte data = (DataBufferByte) raster.getDataBuffer(); + + return new ByteBuffer[]{ByteBuffer.wrap(data.getData())}; + } + */ } \ No newline at end of file