mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2024-11-27 06:10:08 +08:00
fix(skin): remove javafx.swing dep.
This commit is contained in:
parent
ecc38621df
commit
c70898ced7
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user