If I run the attached problem and click the "Copy" button, the following exception appears in stderr:
java.lang.IllegalArgumentException: Wrong byte buffer size 213x139 [118428] != 88821
at com.sun.glass.ui.Pixels.<init>(Pixels.java:64)
at com.sun.glass.ui.win.WinPixels.<init>(WinPixels.java:20)
at com.sun.glass.ui.win.WinApplication.createPixels(WinApplication.java:107)
at com.sun.javafx.tk.quantum.PixelUtils.imageToPixels(PixelUtils.java:28)
at com.sun.javafx.tk.quantum.GlassClipboard.placeImage(GlassClipboard.java:223)
at clipboardtest.Main$1.handle(Main.java:38)
at clipboardtest.Main$1.handle(Main.java:35)
at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:59)
...
Interestingly, if I switch from "new Image(getClass().getResourceAsStream("test.png"))" to "new Image("http://www.oracleimg.com/us/assets/oralogo-small.gif")", placeImage() stops failing but apparently has no effect, that is, does no place anything on the system clipboard.
The HelloImageClipboard toy has a similar problem.
java.lang.IllegalArgumentException: Wrong byte buffer size 213x139 [118428] != 88821
at com.sun.glass.ui.Pixels.<init>(Pixels.java:64)
at com.sun.glass.ui.win.WinPixels.<init>(WinPixels.java:20)
at com.sun.glass.ui.win.WinApplication.createPixels(WinApplication.java:107)
at com.sun.javafx.tk.quantum.PixelUtils.imageToPixels(PixelUtils.java:28)
at com.sun.javafx.tk.quantum.GlassClipboard.placeImage(GlassClipboard.java:223)
at clipboardtest.Main$1.handle(Main.java:38)
at clipboardtest.Main$1.handle(Main.java:35)
at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:59)
...
Interestingly, if I switch from "new Image(getClass().getResourceAsStream("test.png"))" to "new Image("http://www.oracleimg.com/us/assets/oralogo-small.gif")", placeImage() stops failing but apparently has no effect, that is, does no place anything on the system clipboard.
The HelloImageClipboard toy has a similar problem.
- blocks
-
JDK-8112787 "Copy image to clipboard" does nothing
- Resolved
- relates to
-
JDK-8113132 Clipboard.getSystemClipboard().placeContent(UTI.URL, url) has no effect
- Resolved