< prev index next >

modules/javafx.web/src/main/java/com/sun/javafx/webkit/PasteboardImpl.java

Print this page

        

@@ -64,22 +64,22 @@
         content.putString(text);
         content.putHtml(html);
         clipboard.setContent(content);
     }
 
-    @Override public void writeImage(WCImageFrame wcImage) {
+    @Override public void writeImage(WCImageFrame wcImage, String fileExt) {
         Object platformImage = WCGraphicsManager.getGraphicsManager().
                 toPlatformImage(wcImage.getFrame());
         Image fxImage = Toolkit.getImageAccessor().fromPlatformImage(platformImage);
         if (fxImage != null) {
             ClipboardContent content = new ClipboardContent();
             content.putImage(fxImage);
             try {
-                File imageDump = File.createTempFile("jfx", ".png");
+                File imageDump = File.createTempFile("jfx", "." + fileExt);
                 imageDump.deleteOnExit();
                 ImageIO.write(UIClientImpl.toBufferedImage(fxImage),
-                    "png",
+                    fileExt,
                     imageDump);
                 content.putFiles(Arrays.asList(imageDump));
             } catch (IOException | SecurityException e) {
                 // Nothing specific to be done as of now
             }
< prev index next >