保存图片

File file = fileChooser.showSaveDialog(primaryStage.getOwner());
           
           WritableImage wImage = new WritableImage(  300,    500);
           
            try {
                ImageIO.write(SwingFXUtils.fromFXImage(wImage, null), "png", file);
            } catch (IOException e) {
                // TODO Auto-generated catch block
                System.out.println("未选择路径,不保存");
            }

 

转载于:https://www.cnblogs.com/JNUX/p/7340216.html

你可能感兴趣的:(保存图片)