fix(skin): remove javafx.swing dep.

This commit is contained in:
huanghongxun 2021-09-26 21:50:29 +08:00
parent ecc38621df
commit c70898ced7

View File

@ -1,16 +1,10 @@
package moe.mickey.minecraft.skin.fx;
import javafx.embed.swing.SwingFXUtils;
import javafx.scene.image.Image;
import javafx.scene.image.PixelReader;
import javafx.scene.image.PixelWriter;
import javafx.scene.image.WritableImage;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
public final class SkinHelper {
private SkinHelper() {
@ -128,13 +122,4 @@ public final class SkinHelper {
return newSkin;
}
public static void saveToFile(Image image, File output) {
BufferedImage buffer = SwingFXUtils.fromFXImage(image, null);
try {
ImageIO.write(buffer, "png", output);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}