i'am using JavaFX and illustrate a Chart with the LineChart concept in Javafx. If i draw a chart, i export a screenshot of this with this code.
WritableImage image = lc.snapshot(new SnapshotParameters(), null);
File file = new File("Chart.png");
try {
ImageIO.write(SwingFXUtils.fromFXImage(image, null), "png", file);
}
catch (IOException e) {
//bla
}
This works perfect!
Now: is there a simple way to create this "WritableImage" image to a Base64 String? Furthermore i want to use it to reproduce this Base64-String to a PNG file in PHP.
Any Ideas? THX