Scratch for Java

GifEncoder::addFrame()

Browser availability: desktop-only.

The encoder behind the desktop's GifRecorder; recording is desktop-only.

Adds next GIF frame as an ARGB pixel array, top row first (0xAARRGGBB). The alpha channel is ignored. The frame is not written immediately, but is actually deferred until the next frame is received so that timing data can be inserted. Invoking finish() flushes all frames. The size of the first frame is used for all subsequent frames; frames of another size are scaled with nearest-neighbour sampling.

Syntax

Java

.addFrame(argb, width, height)

Parameters

Name Data Type Description
argb int[] int array containing the frame's pixels, top row first.
width int int frame width.
height int int frame height.

Return

boolean

addFrame()

Create Shareable URL

Select Sections