Libraryless. Click here for Pure Java version (11009L/63K).
static BufferedImage getImageFromClipboard() ctex { Transferable t = rawClipboardContents(); if (t == null) null; L<File> l = cast getTransferData(t, DataFlavor.javaFileListFlavor); if (nempty(l)) ret loadImage2(first(l)); if (t.isDataFlavorSupported(DataFlavor.imageFlavor)) ret (BufferedImage) t.getTransferData(DataFlavor.imageFlavor); ret imageFromDataURL(getTextFromClipboard()); }
download show line numbers debug dex old transpilations
Travelled to 16 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, sawdedvomwva, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1006059 |
| Snippet name: | getImageFromClipboard |
| Eternal ID of this version: | #1006059/10 |
| Text MD5: | 940165628c088cb6582e2c81d7c10499 |
| Transpilation MD5: | 61f79cb12002c458e4b23b67ba9908a9 |
| Author: | stefan |
| Category: | javax / gui |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2022-07-29 19:27:44 |
| Source code size: | 423 bytes / 12 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 916 / 1059 |
| Version history: | 9 change(s) |
| Referenced in: | #1006096 - getBWImageFromClipboard #1006100 - getTextFromClipboard #1006654 - Standard functions list 2 (LIVE, continuation of #761) #1035797 - clipboardContainsImage |