I am currently trying to create an image from a TableView
using snapshot, and the snapshot is only grabbing the tableview that is visible on the screen. I've tried messing with the SnapshotPreferences
viewport, but that didn't help. Any suggestions or workarounds would be appreciated.
EDIT: I have now also tried creating a new pane of the same width and height of the TableView
, adding the TableView
, and taking a snapshot of that, but it ends up blank. I've continued to play around with this. Creating a new pane and adding it to a scene gives me all the columns of the TableView
, but not all the rows.
Code to take the snapshot is below.
WritableImage image = null;
//Get the node
TableView<ObservableList<ObjectProperty<Item>>>pattern = mainApp.getPVController().getPattern();
//Create rectangle to define viewport
Rectangle2D rect = new Rectangle2D(0, 0, pattern.getWidth(), pattern.getHeight());
//Define snapshot parameters
SnapshotParameters params = new SnapshotParameters();
params.setViewport(rect);
//Take the snapshot
image = pattern.snapshot(params, image);