Libraryless. Click here for Pure Java version (9460L/52K).
1 | sbool clipboardContainsImage() false on exception { |
2 | Transferable t = rawClipboardContents(); |
3 | if (t == null) false; |
4 | |
5 | // Try image flavor |
6 | if (t.isDataFlavorSupported(DataFlavor.imageFlavor)) true; |
7 | |
8 | // Try image file |
9 | L<File> l = cast getTransferData(t, DataFlavor.javaFileListFlavor); |
10 | if (isImageFile(first(l))) true; |
11 | |
12 | // Try image as data URL |
13 | S text = getTextFromClipboard(); |
14 | ret isImageMimeType(dataURLMimeType(text)); |
15 | } |
Began life as a copy of #1006059
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): elmgxqgtpvxh, mqqgnosmbjvj, wnsclhtenguj
No comments. add comment
Snippet ID: | #1035797 |
Snippet name: | clipboardContainsImage |
Eternal ID of this version: | #1035797/3 |
Text MD5: | ba4634dd18b5e2422e68f332adff4924 |
Transpilation MD5: | bd0909a067557c4adab35895de0194db |
Author: | stefan |
Category: | javax / clipboard |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-07-29 19:25:58 |
Source code size: | 459 bytes / 15 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 147 / 207 |
Version history: | 2 change(s) |
Referenced in: | [show references] |