Example usage for javafx.scene.input DataFormat IMAGE

List of usage examples for javafx.scene.input DataFormat IMAGE

Introduction

In this page you can find the example usage for javafx.scene.input DataFormat IMAGE.

Prototype

DataFormat IMAGE

To view the source code for javafx.scene.input DataFormat IMAGE.

Click Source Link

Document

A special platform specific image type, such as is commonly used on the clipboard and interoperates widely with other applications.

Usage

From source file:com.chart.SwingChart.java

/**
 * Copy to clipboard/*w w  w.  j av  a2 s. c  o  m*/
 * @param node JavaFX Node to copy
 */
public final void copyClipboard(final Node node) {

    WritableImage captura = node.snapshot(new SnapshotParameters(), null);

    ImageView iv = new ImageView(captura);

    Clipboard clipboard = Clipboard.getSystemClipboard();
    ClipboardContent content = new ClipboardContent();
    content.put(DataFormat.IMAGE, captura);
    clipboard.setContent(content);

}