Comments (3)
`/*
- To change this license header, choose License Headers in Project Properties.
- To change this template file, choose Tools | Templates
- and open the template in the editor.
*/
package jemu.ui.paint;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Toolkit;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;
import java.awt.datatransfer.UnsupportedFlavorException;
import java.awt.image.BufferedImage;
import java.io.IOException;
/**
*
-
@author Markus
*/
public class ImageFromClipboard {public Image getImageFromClipboard() {
Transferable transferable = Toolkit.getDefaultToolkit().getSystemClipboard().getContents(null);
if (transferable != null && transferable.isDataFlavorSupported(DataFlavor.imageFlavor)) {
try {
return (Image) transferable.getTransferData(DataFlavor.imageFlavor);
} catch (UnsupportedFlavorException e) {
// handle this as desired
e.printStackTrace();
} catch (IOException e) {
// handle this as desired
e.printStackTrace();
}
}
return null;
}public BufferedImage getBufferedImageFromClipboard() {
Image clip = getImageFromClipboard();
if (clip == null) {
return null;
}
BufferedImage buffclip = new BufferedImage(clip.getWidth(null), clip.getHeight(null), BufferedImage.TYPE_INT_ARGB);
Graphics g = buffclip.createGraphics();
g.drawImage(clip, 0, 0, null);
return buffclip;
}
}
`
from dskmanager.
File to Desktop.
from dskmanager.
Done
from dskmanager.
Related Issues (20)
- AMS-HEADER HOT 4
- USER:0 HOT 2
- AMSDOS Header added to file entered (not normal) HOT 1
- Discology UCPM dsk not detected HOT 1
- Format IBM HOT 1
- Detect DskType HOT 1
- Logger HOT 1
- Vortex with UCPM
- drop name, remove spaces. HOT 1
- Message if using systemDS80 HOT 4
- Cursors HOT 1
- Half EntryFile PARADOS80 PARADOS40D HOT 2
- FutureOS filename with space in middle of filename + lowerCase HOT 1
- Open with> DskManager HOT 1
- Vortex with large files HOT 8
- patch Markus HOT 1
- patch 2 Markus HOT 1
- Only Vortex does use lowercase
- AMSDOS header contains true file name
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dskmanager.