I tried to make snapshot of my node. But my node is not fit the parent, so i should use ScrollPane. It's looks well on my scene, but when i save the snapshot as png, it has some problems with backgroung color.

So i want to create SnapshotParameters and setFill() according to css -fx-background-color. So how to do this?

The program has some different themes, so hardcoded color isn't good idea.

.visualisation-content{
    -fx-background-color: #1E1E1E;
    -fx-background: #1E1E1E;
}    


SnapshotParameters snapshotParameters = new SnapshotParameters();
snapshotParameters.setFill(Color.web("#1E1E1E"));

0 Answers