GifOptions

Inheritance: java.lang.Object, com.aspose.slides.SaveOptions

All Implemented Interfaces: com.aspose.slides.IGifOptions

public class GifOptions extends SaveOptions implements IGifOptions

Represents GIF exporting options.


The following example shows how to converting presentations to animated GIF using custom settings.
 
 Presentation pres = new Presentation("pres.pptx");
 try {
     GifOptions gifOptions = new GifOptions();
     gifOptions.setFrameSize(new Dimension(960, 720)); // the size of the resulted GIF
     gifOptions.setDefaultDelay(2000); // how long each slide will be showed until it will be changed to the next one
     gifOptions.setTransitionFps(35); // increase FPS to better transition animation quality
     pres.save("pres.gif", SaveFormat.Gif, gifOptions);
 } finally {
     if (pres != null) pres.dispose();
 }

Constructors

ConstructorDescription
GifOptions()Initializes a new instance of the GifOptions class.

Methods

MethodDescription
getFrameSize()Gets or sets frame size.
setFrameSize(Dimension value)Gets or sets frame size.
getExportHiddenSlides()Determines whether hidden slides will be exported.
setExportHiddenSlides(boolean value)Determines whether hidden slides will be exported.
getTransitionFps()Gets or sets transition FPS [frames/sec] The default value is 25.
setTransitionFps(int value)Gets or sets transition FPS [frames/sec] The default value is 25.
getDefaultDelay()Gets or sets default delay time [ms].
setDefaultDelay(int value)Gets or sets default delay time [ms].

GifOptions()

public GifOptions()

Initializes a new instance of the GifOptions class.

getFrameSize()

public final Dimension getFrameSize()

Gets or sets frame size.


If the size is empty then the value will be taken from (IPresentation.getSlideSize)

Returns: java.awt.Dimension

setFrameSize(Dimension value)

public final void setFrameSize(Dimension value)

Gets or sets frame size.


If the size is empty then the value will be taken from (IPresentation.getSlideSize)

Parameters:

ParameterTypeDescription
valuejava.awt.Dimension

getExportHiddenSlides()

public final boolean getExportHiddenSlides()

Determines whether hidden slides will be exported. The default value is false.


Presentation pres = new Presentation("pres.pptx");
 try {
     GifOptions gifOptions = new GifOptions();
     gifOptions.setExportHiddenSlides(false);
     pres.save("pres.gif", SaveFormat.Gif, gifOptions);
 } finally {
     if (pres != null) pres.dispose();
 }

Returns: boolean

setExportHiddenSlides(boolean value)

public final void setExportHiddenSlides(boolean value)

Determines whether hidden slides will be exported. The default value is false.


Presentation pres = new Presentation("pres.pptx");
 try {
     GifOptions gifOptions = new GifOptions();
     gifOptions.setExportHiddenSlides(false);
     pres.save("pres.gif", SaveFormat.Gif, gifOptions);
 } finally {
     if (pres != null) pres.dispose();
 }

Parameters:

ParameterTypeDescription
valueboolean

getTransitionFps()

public final int getTransitionFps()

Gets or sets transition FPS [frames/sec] The default value is 25.


Presentation pres = new Presentation("pres.pptx");
 try {
     GifOptions gifOptions = new GifOptions();
     gifOptions.setTransitionFps(60);
     pres.save("pres.gif", SaveFormat.Gif, gifOptions);
 } finally {
     if (pres != null) pres.dispose();
 }

Returns: int

setTransitionFps(int value)

public final void setTransitionFps(int value)

Gets or sets transition FPS [frames/sec] The default value is 25.


Presentation pres = new Presentation("pres.pptx");
 try {
     GifOptions gifOptions = new GifOptions();
     gifOptions.setTransitionFps(60);
     pres.save("pres.gif", SaveFormat.Gif, gifOptions);
 } finally {
     if (pres != null) pres.dispose();
 }

Parameters:

ParameterTypeDescription
valueint

getDefaultDelay()

public final int getDefaultDelay()

Gets or sets default delay time [ms]. This value will be used if (ISlideShowTransition.getAdvanceAfterTime/ISlideShowTransition.setAdvanceAfterTime(long)) is not set. The default value is 1000.


Presentation pres = new Presentation("pres.pptx");
 try {
     GifOptions gifOptions = new GifOptions();
     gifOptions.setDefaultDelay(2000);
     pres.save("pres.gif", SaveFormat.Gif, gifOptions);
 } finally {
     if (pres != null) pres.dispose();
 }

Returns: int

setDefaultDelay(int value)

public final void setDefaultDelay(int value)

Gets or sets default delay time [ms]. This value will be used if (ISlideShowTransition.getAdvanceAfterTime/ISlideShowTransition.setAdvanceAfterTime(long)) is not set. The default value is 1000.


Presentation pres = new Presentation("pres.pptx");
 try {
     GifOptions gifOptions = new GifOptions();
     gifOptions.setDefaultDelay(2000);
     pres.save("pres.gif", SaveFormat.Gif, gifOptions);
 } finally {
     if (pres != null) pres.dispose();
 }

Parameters:

ParameterTypeDescription
valueint