Class FrameRecorder
java.lang.Object
org.openpatch.scratch.extensions.recorder.Recorder
org.openpatch.scratch.extensions.recorder.FrameRecorder
The FrameRecorder class extends the Recorder class to provide functionality for saving frames of
an applet as PNG files. It allows saving the current frame with a generated filename based on the
frame number or taking a snapshot with a specified filename.
Usage example:
FrameRecorder recorder = new FrameRecorder("/path/to/output/folder"); recorder.saveFrame(); // Saves the current frame with a generated filename recorder.snapshot("snapshot.png"); // Saves the current frame as "snapshot.png"
-
Constructor Summary
ConstructorDescriptionFrameRecorder
(String outputFolder) Constructs a new FrameRecorder with the specified output folder. -
Method Summary
-
Constructor Details
-
FrameRecorder
Constructs a new FrameRecorder with the specified output folder.- Parameters:
outputFolder
- the folder where the recorded frames will be saved
-
-
Method Details
-
saveFrame
public void saveFrame()Saves the current frame of the applet to the specified output folder. The frame is saved as a PNG file with a filename pattern "#######.png". The exact filename will be generated based on the current frame number. -
snapshot
Takes a snapshot of the current frame and saves it to the specified filename.- Parameters:
filename
- the name of the file to save the snapshot to
-