Packages

 

com.aspose.imaging.imageoptions

Class TimeInterval



  • public class TimeInterval
    extends Object

    Represents the time interval in milliseconds

    Code 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);
    }
    

    • Constructor Detail

      • TimeInterval

        public TimeInterval(long from,
                            long to)

        Initializes a new instance of the TimeInterval class.

        Parameters:
        from - From milliseconds.
        to - To milliseconds.
    • Method Detail

      • getFrom

        public final long getFrom()

        Gets From milliseconds.

      • setFrom

        public final void setFrom(long value)

        Sets From milliseconds.

      • getTo

        public final long getTo()

        Gets To milliseconds.

      • setTo

        public final void setTo(long value)

        Sets To milliseconds.