public class ApngOptions extends PngOptions
The animated PNG file format options
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
}
DEFAULT_COMPRESSION_LEVEL| Constructor and Description |
|---|
ApngOptions()
Initializes a new instance of the
ApngOptions class. |
ApngOptions(ApngOptions apngOptions)
Initializes a new instance of the
ApngOptions class. |
| Modifier and Type | Method and Description |
|---|---|
long |
getDefaultFrameTime()
Gets the default frame duration.
|
int |
getNumPlays()
Gets the number of times to loop animation.
|
void |
setDefaultFrameTime(long value)
Sets the default frame duration.
|
void |
setNumPlays(int value)
Sets the number of times to loop animation.
|
getBitDepth, getColorType, getCompressionLevel, getFilterType, getProgressive, getXmpData, setBitDepth, setColorType, setCompressionLevel, setFilterType, setProgressive, setXmpDatadeepClone, getBufferSizeHint, getFullFrame, getMultiPageOptions, getPalette, getProgressEventHandler, getResolutionSettings, getSource, getVectorRasterizationOptions, setBufferSizeHint, setFullFrame, setMultiPageOptions, setPalette, setProgressEventHandler, setResolutionSettings, setSource, setVectorRasterizationOptionsclose, dispose, getDisposedpublic ApngOptions()
Initializes a new instance of the ApngOptions class.
public ApngOptions(ApngOptions apngOptions)
Initializes a new instance of the ApngOptions class.
apngOptions - The PNG options.public final int getNumPlays()
Gets the number of times to loop animation. 0 indicates infinite looping.
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
}
public final void setNumPlays(int value)
Sets the number of times to loop animation. 0 indicates infinite looping.
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
}
public final long getDefaultFrameTime()
Gets the default frame duration.
public final void setDefaultFrameTime(long value)
Sets the default frame duration.
Copyright (c) 2008-2022 Aspose Pty Ltd. All Rights Reserved.