Packages

 

com.aspose.imaging.imageoptions

Class ApngOptions

  • All Implemented Interfaces:
    com.aspose.ms.System.IDisposable, Closeable, AutoCloseable


    public class ApngOptions
    extends PngOptions

    The animated PNG file format options

    Code example:

    The following example shows how to export to APNG file format.


    
    import com.aspose.imaging;
    import com.aspose.imaging.imageoptions;
    
    try (Image image = Image.load("Animation1.webp"))
    {
        // Export to APNG animation with unlimited animation cycles as default
        image.save("Animation1.webp.png", new ApngOptions());
        // Setting up animation cycles
        ApngOptions options = new ApngOptions();
        options.setNumPlays(5);
        image.save("Animation2.webp.png", options); // 5 cycles
    }
    

    • Constructor Detail

      • ApngOptions

        public ApngOptions()
    • Method Detail

      • getNumPlays

        public final int getNumPlays()

        Gets the number of times to loop animation. 0 indicates infinite looping.

        Returns:
        Code example:

        The following example shows how to export to APNG file format.


        
        import com.aspose.imaging;
        import com.aspose.imaging.imageoptions;
        
        try (Image image = Image.load("Animation1.webp"))
        {
            // Export to APNG animation with unlimited animation cycles as default
            image.save("Animation1.webp.png", new ApngOptions());
            // Setting up animation cycles
            ApngOptions options = new ApngOptions();
            options.setNumPlays(5);
            image.save("Animation2.webp.png", options); // 5 cycles
        }
        

      • setNumPlays

        public final void setNumPlays(int value)

        Sets the number of times to loop animation. 0 indicates infinite looping.

        Parameters:
        value -
        Code example:

        The following example shows how to export to APNG file format.


        
        import com.aspose.imaging;
        import com.aspose.imaging.imageoptions;
        
        try (Image image = Image.load("Animation1.webp"))
        {
            // Export to APNG animation with unlimited animation cycles as default
            image.save("Animation1.webp.png", new ApngOptions());
            // Setting up animation cycles
            ApngOptions options = new ApngOptions();
            options.setNumPlays(5);
            image.save("Animation2.webp.png", options); // 5 cycles
        }
        

      • getDefaultFrameTime

        public final long getDefaultFrameTime()

        Gets the default frame duration.

        Returns:
      • setDefaultFrameTime

        public final void setDefaultFrameTime(long value)

        Sets the default frame duration.

        Parameters:
        value -