Scratch for Java

GifRecorder()

Browser availability: desktop-only.

This API requires the desktop runtime. Browser declarations may report the limitation without performing the operation.

The GifRecorder class is responsible for recording and saving frames as GIF images. It extends the Recorder class and utilizes the AnimatedGifEncoder to create GIF files.

The class provides methods to start and stop the recording process, save individual frames, and capture snapshots as GIF images.

The GifRecorder class handles potential NullPointerExceptions that may occur during the frame saving process.

Example usage:

GifRecorder recorder = new GifRecorder("output.gif");
recorder.start();
// Capture frames
recorder.stop();

Syntax

Java

new GifRecorder(filePath)

Static Fields

Name Type Description
transparent Color The transparent color used in the GIF image.
GifRecorder()

Create Shareable URL

Select Sections