(Reply Post #7)
A rather late answer, but thought I share a solution as building a JavaFX Dashboard running on a Raspberry Pi 3 Model B+ (RPi).
The dashboard is part of a
Home Automation solution in progress.
Started developing the dashboard step-by-step and one feature is to make a screenshot of the dashboard when running on the RPi.
Create Screenshot
Example creating a screenshot of the main form when the application runs in full screen on a Raspberry Pi.
Tested on a RPi 3 Model B+ running Stretch, jdk1.8.0_162, Gluon JavaFXPorts armv6hf-sdk-8.60.9.
Requirements
#Region Project Attributes
#MainFormWidth: 600
#MainFormHeight: 600
'The jar jfxrt is required for the class SwingFXUtils to make a screenshot of the mainform when running on the RPi.
'This to avoid runtime error: java.lang.NoClassDefFoundError: javafx/embed/swing/SwingFXUtils
'Copy c:\Program Files (x86)\Java\jdk8\jre\lib\ext\jfxrt.jar to the B4J additional libraries folder.
'Note: Check your JDK path prior copying to the B4J additional library folder.
#AdditionalJar: jfxrt
#MergeLibraries: True
#End Region
Example sub make a snapshot of the mainform
Sub FormSnapShot
Dim img As Image = MainForm.RootPane.Snapshot
Dim Out As OutputStream = File.OpenOutput(File.DirApp, "rpicputemperaturedashboard.png", False)
img.WriteToStream(Out)
Out.Close
End Sub
Notes
When running via the B4J-Bridge, the screenshot is stored in the tempjars folder.
Example Dashboard Raspberry Pi CPU Temperature (measured every 5 seconds)
The B4J source attached - the CPU Temperature is measured using resumable sub, the gauge properties are set using API method via a JavaObject.