mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-15 06:45:42 -04: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;
|
package moe.mickey.minecraft.skin.fx;
|
||||||
|
|
||||||
import javafx.embed.swing.SwingFXUtils;
|
|
||||||
import javafx.scene.image.Image;
|
import javafx.scene.image.Image;
|
||||||
import javafx.scene.image.PixelReader;
|
import javafx.scene.image.PixelReader;
|
||||||
import javafx.scene.image.PixelWriter;
|
import javafx.scene.image.PixelWriter;
|
||||||
import javafx.scene.image.WritableImage;
|
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 {
|
public final class SkinHelper {
|
||||||
|
|
||||||
private SkinHelper() {
|
private SkinHelper() {
|
||||||
@ -128,13 +122,4 @@ public final class SkinHelper {
|
|||||||
return newSkin;
|
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…
x
Reference in New Issue
Block a user