Libraryless. Click here for Pure Java version (11009L/63K).
1 | static BufferedImage getImageFromClipboard() ctex { |
2 | Transferable t = rawClipboardContents(); |
3 | if (t == null) null; |
4 | |
5 | L<File> l = cast getTransferData(t, DataFlavor.javaFileListFlavor); |
6 | if (nempty(l)) |
7 | ret loadImage2(first(l)); |
8 | |
9 | if (t.isDataFlavorSupported(DataFlavor.imageFlavor)) |
10 | ret (BufferedImage) t.getTransferData(DataFlavor.imageFlavor); |
11 | ret imageFromDataURL(getTextFromClipboard()); |
12 | } |
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: | 694 / 804 |
Version history: | 9 change(s) |
Referenced in: | [show references] |