TimeInterval

Inheritance: java.lang.Object

public class TimeInterval

Represents the time interval in milliseconds

Constructors

ConstructorDescription
TimeInterval(long from, long to)Initializes a new instance of the TimeInterval class.

Methods

MethodDescription
getFrom()Gets From milliseconds.
setFrom(long value)Sets From milliseconds.
getTo()Gets To milliseconds.
setTo(long value)Sets To milliseconds.

Example: Export of part of animation from GIF image based on time interval.

try (Image image = Image.load("Animation.gif"))
{
    GifOptions options = new GifOptions();
    options.setFullFrame(true);
    final MultiPageOptions multiPageOptions = new MultiPageOptions();
    multiPageOptions.setMode(MultiPageMode.TimeInterval);
    multiPageOptions.setTimeInterval(new TimeInterval(0, 400));
    options.setMultiPageOptions(multiPageOptions);

    image.save("PartOfAnimation.gif", options);
}

TimeInterval(long from, long to)

public TimeInterval(long from, long to)

Initializes a new instance of the TimeInterval class.

Parameters:

ParameterTypeDescription
fromlongFrom milliseconds.
tolongTo milliseconds.

getFrom()

public final long getFrom()

Gets From milliseconds.

Returns: long

setFrom(long value)

public final void setFrom(long value)

Sets From milliseconds.

Parameters:

ParameterTypeDescription
valuelong

getTo()

public final long getTo()

Gets To milliseconds.

Returns: long

setTo(long value)

public final void setTo(long value)

Sets To milliseconds.

Parameters:

ParameterTypeDescription
valuelong