Manage Presentation Zoom on Android
Introduction
PowerPoint zooms let you navigate between specific slides and sections during a slide show. With Aspose.Slides for Android via Java, you can create slide, section, and summary zooms and customize their previews, borders, and transitions.

- To summarize an entire presentation on a single slide, use a Summary Zoom.
- To show selected slides only, use a Slide Zoom.
- To show a single section only, use a Section Zoom.
Slide Zoom
A slide zoom can make your presentation more dynamic, allowing you to navigate freely between slides in any order you choose without interrupting the flow of your presentation. Slide zooms are great for short presentations without many sections, but you can still use them in different presentation scenarios.
Slide zooms let you explore related information from a single overview slide.

For slide zoom objects, Aspose.Slides provides the ZoomImageType enumeration, the IZoomFrame interface, and methods on the IShapeCollection interface.
Create Zoom Frames
Use IShapeCollection.addZoomFrame to place links to individual slides on an overview slide. This example creates two target slides with distinct backgrounds and labels, then adds a preview of each to the first slide and saves the presentation as PPTX. Frame positions and dimensions are specified in points.
import com.aspose.slides.*;
import android.graphics.Color;
Presentation presentation = new Presentation();
try {
ISlide overviewSlide = presentation.getSlides().get_Item(0);
ISlide secondSlide = presentation.getSlides().addEmptySlide(overviewSlide.getLayoutSlide());
ISlide thirdSlide = presentation.getSlides().addEmptySlide(overviewSlide.getLayoutSlide());
secondSlide.getBackground().setType(BackgroundType.OwnBackground);
secondSlide.getBackground().getFillFormat().setFillType(FillType.Solid);
secondSlide.getBackground().getFillFormat().getSolidFillColor().setColor(Color.CYAN);
IAutoShape textBox = secondSlide.getShapes().addAutoShape(ShapeType.Rectangle, 100, 200, 500, 200);
textBox.getTextFrame().setText("Second Slide");
thirdSlide.getBackground().setType(BackgroundType.OwnBackground);
thirdSlide.getBackground().getFillFormat().setFillType(FillType.Solid);
thirdSlide.getBackground().getFillFormat().getSolidFillColor().setColor(Color.rgb(189, 183, 107));
textBox = thirdSlide.getShapes().addAutoShape(ShapeType.Rectangle, 100, 200, 500, 200);
textBox.getTextFrame().setText("Third Slide");
overviewSlide.getShapes().addZoomFrame(20, 20, 250, 200, secondSlide);
overviewSlide.getShapes().addZoomFrame(200, 250, 250, 200, thirdSlide);
presentation.save("presentation.pptx", SaveFormat.Pptx);
} finally {
presentation.dispose();
}
Create Zoom Frames with Custom Images
Pass a custom image to IShapeCollection.addZoomFrame to replace the target slide’s default preview. This example requires a local image, loads it with Images.fromFile, and adds it to the presentation using IImageCollection.addImage. The resulting frame displays that image while still linking to the second slide.
import com.aspose.slides.*;
import android.graphics.Color;
Presentation presentation = new Presentation();
try {
ISlide overviewSlide = presentation.getSlides().get_Item(0);
ISlide slide = presentation.getSlides().addEmptySlide(overviewSlide.getLayoutSlide());
slide.getBackground().setType(BackgroundType.OwnBackground);
slide.getBackground().getFillFormat().setFillType(FillType.Solid);
slide.getBackground().getFillFormat().getSolidFillColor().setColor(Color.CYAN);
IAutoShape textBox = slide.getShapes().addAutoShape(ShapeType.Rectangle, 100, 200, 500, 200);
textBox.getTextFrame().setText("Second Slide");
IPPImage previewImage;
IImage image = Images.fromFile("image.png");
try {
previewImage = presentation.getImages().addImage(image);
} finally {
image.dispose();
}
overviewSlide.getShapes().addZoomFrame(20, 20, 300, 200, slide, previewImage);
presentation.save("presentation.pptx", SaveFormat.Pptx);
} finally {
presentation.dispose();
}
Format Zoom Frames
This example customizes two slide zoom frames. It assigns a local image to the first frame through IZoomObject.setZoomImage, and gives the second frame a five-point, dash-dot pink border through IShape.getLineFormat. Passing false to IZoomObject.setShowBackground hides the second frame’s background. A local image is required for the custom preview; both frames retain their slide targets in the saved PPTX.
import com.aspose.slides.*;
import android.graphics.Color;
Presentation presentation = new Presentation();
try {
ISlide overviewSlide = presentation.getSlides().get_Item(0);
ISlide secondSlide = presentation.getSlides().addEmptySlide(overviewSlide.getLayoutSlide());
ISlide thirdSlide = presentation.getSlides().addEmptySlide(overviewSlide.getLayoutSlide());
secondSlide.getBackground().setType(BackgroundType.OwnBackground);
secondSlide.getBackground().getFillFormat().setFillType(FillType.Solid);
secondSlide.getBackground().getFillFormat().getSolidFillColor().setColor(Color.CYAN);
IAutoShape textBox = secondSlide.getShapes().addAutoShape(ShapeType.Rectangle, 100, 200, 500, 200);
textBox.getTextFrame().setText("Second Slide");
thirdSlide.getBackground().setType(BackgroundType.OwnBackground);
thirdSlide.getBackground().getFillFormat().setFillType(FillType.Solid);
thirdSlide.getBackground().getFillFormat().getSolidFillColor().setColor(Color.rgb(189, 183, 107));
textBox = thirdSlide.getShapes().addAutoShape(ShapeType.Rectangle, 100, 200, 500, 200);
textBox.getTextFrame().setText("Third Slide");
IZoomFrame firstZoomFrame = overviewSlide.getShapes().addZoomFrame(20, 20, 250, 200, secondSlide);
IZoomFrame secondZoomFrame = overviewSlide.getShapes().addZoomFrame(200, 250, 250, 200, thirdSlide);
IPPImage previewImage;
IImage image = Images.fromFile("image.png");
try {
previewImage = presentation.getImages().addImage(image);
} finally {
image.dispose();
}
firstZoomFrame.setZoomImage(previewImage);
secondZoomFrame.getLineFormat().setWidth(5);
secondZoomFrame.getLineFormat().getFillFormat().setFillType(FillType.Solid);
secondZoomFrame.getLineFormat().getFillFormat().getSolidFillColor().setColor(Color.rgb(255, 105, 180));
secondZoomFrame.getLineFormat().setDashStyle(LineDashStyle.DashDot);
secondZoomFrame.setShowBackground(false);
presentation.save("presentation.pptx", SaveFormat.Pptx);
} finally {
presentation.dispose();
}
Section Zoom
A section zoom links to a section in your presentation. Use it to revisit a topic or show how different parts of the presentation connect.

For section zoom objects, Aspose.Slides provides the ISectionZoomFrame interface and methods on the IShapeCollection interface.
Create Section Zoom Frames
Create a section with ISectionCollection.addSection, then pass the returned section to IShapeCollection.addSectionZoomFrame. This example places a section zoom on the first slide and links it to a section beginning with a colored slide. The frame’s position and dimensions are specified in points, and the presentation is saved as PPTX.
import com.aspose.slides.*;
import android.graphics.Color;
Presentation presentation = new Presentation();
try {
ISlide overviewSlide = presentation.getSlides().get_Item(0);
ISlide slide = presentation.getSlides().addEmptySlide(overviewSlide.getLayoutSlide());
slide.getBackground().getFillFormat().setFillType(FillType.Solid);
slide.getBackground().getFillFormat().getSolidFillColor().setColor(Color.rgb(154, 205, 50));
slide.getBackground().setType(BackgroundType.OwnBackground);
ISection section = presentation.getSections().addSection("Section 1", slide);
ISectionZoomFrame sectionZoomFrame = overviewSlide.getShapes().addSectionZoomFrame(20, 20, 300, 200, section);
presentation.save("presentation.pptx", SaveFormat.Pptx);
} finally {
presentation.dispose();
}
Create Section Zoom Frames with Custom Images
The image overload of IShapeCollection.addSectionZoomFrame lets you display a custom preview without changing the destination section. This example requires a local image, which is loaded with Images.fromFile and added through IImageCollection.addImage. The saved presentation contains a section zoom on the first slide linked to the newly created section.
import com.aspose.slides.*;
import android.graphics.Color;
Presentation presentation = new Presentation();
try {
ISlide overviewSlide = presentation.getSlides().get_Item(0);
ISlide slide = presentation.getSlides().addEmptySlide(overviewSlide.getLayoutSlide());
slide.getBackground().getFillFormat().setFillType(FillType.Solid);
slide.getBackground().getFillFormat().getSolidFillColor().setColor(Color.rgb(154, 205, 50));
slide.getBackground().setType(BackgroundType.OwnBackground);
IPPImage previewImage;
IImage image = Images.fromFile("image.png");
try {
previewImage = presentation.getImages().addImage(image);
} finally {
image.dispose();
}
ISection section = presentation.getSections().addSection("Section 1", slide);
ISectionZoomFrame sectionZoomFrame = overviewSlide.getShapes().addSectionZoomFrame(20, 20, 300, 200, section, previewImage);
presentation.save("presentation.pptx", SaveFormat.Pptx);
} finally {
presentation.dispose();
}
Change a Section Zoom’s Target Section
Use ISectionZoomFrame.setTargetSection to redirect an existing section zoom without recreating it. Choose a populated section from the same presentation’s Presentation.getSections collection. Assigning an empty section leaves the current target unchanged, so check ISection.getSlidesListOfSection before assigning it. See Manage Slide Sections for more about sections.
The following example loads a presentation file, which must contain multiple populated sections, an existing section zoom named Section navigation, and a section with the unique name Results. It searches all slides for the zoom and finds the destination by name rather than by a collection index that can change when sections are reordered. If names are not unique, use ISection.getSectionId to identify the destination instead.
import com.aspose.slides.*;
Presentation presentation = new Presentation("section-zoom.pptx");
try {
ISectionZoomFrame zoom = null;
for (ISlide slide : presentation.getSlides()) {
for (IShape shape : slide.getShapes()) {
if (shape instanceof ISectionZoomFrame && "Section navigation".equals(shape.getName())) {
zoom = (ISectionZoomFrame) shape;
break;
}
}
if (zoom != null) {
break;
}
}
ISection targetSection = null;
for (ISection section : presentation.getSections()) {
if ("Results".equals(section.getName())) {
targetSection = section;
break;
}
}
if (zoom == null || targetSection == null) {
System.out.println("The section zoom or destination section was not found.");
} else if (targetSection.getSlidesListOfSection().size() == 0) {
System.out.println("The destination section is empty.");
} else {
ISection currentSection = zoom.getTargetSection();
System.out.println("Current section: " + (currentSection == null ? "" : currentSection.getName()));
zoom.setTargetSection(targetSection);
presentation.save("section-zoom-updated.pptx", SaveFormat.Pptx);
}
} finally {
presentation.dispose();
}
Format Section Zoom Frames
This example moves and resizes a section zoom to 100 by 75 points, assigns a local image through IZoomObject.setZoomImage, and applies a 2.5-point, dash-dot brown border. It enables IZoomObject.setReturnToParent to return to the originating slide after the section, disables IZoomObject.setShowBackground, and sets IZoomObject.setTransitionDuration to 1.5 seconds. A local image is required for the custom preview.
import com.aspose.slides.*;
import android.graphics.Color;
Presentation presentation = new Presentation();
try {
ISlide overviewSlide = presentation.getSlides().get_Item(0);
ISlide slide = presentation.getSlides().addEmptySlide(overviewSlide.getLayoutSlide());
slide.getBackground().getFillFormat().setFillType(FillType.Solid);
slide.getBackground().getFillFormat().getSolidFillColor().setColor(Color.rgb(154, 205, 50));
slide.getBackground().setType(BackgroundType.OwnBackground);
ISection section = presentation.getSections().addSection("Section 1", slide);
ISectionZoomFrame sectionZoomFrame = overviewSlide.getShapes().addSectionZoomFrame(20, 20, 300, 200, section);
sectionZoomFrame.setX(100);
sectionZoomFrame.setY(300);
sectionZoomFrame.setWidth(100);
sectionZoomFrame.setHeight(75);
IPPImage previewImage;
IImage image = Images.fromFile("image.png");
try {
previewImage = presentation.getImages().addImage(image);
} finally {
image.dispose();
}
sectionZoomFrame.setZoomImage(previewImage);
sectionZoomFrame.setReturnToParent(true);
sectionZoomFrame.setShowBackground(false);
sectionZoomFrame.getLineFormat().getFillFormat().setFillType(FillType.Solid);
sectionZoomFrame.getLineFormat().getFillFormat().getSolidFillColor().setColor(Color.rgb(165, 42, 42));
sectionZoomFrame.getLineFormat().setDashStyle(LineDashStyle.DashDot);
sectionZoomFrame.getLineFormat().setWidth(2.5f);
sectionZoomFrame.setTransitionDuration(1.5f);
presentation.save("presentation.pptx", SaveFormat.Pptx);
} finally {
presentation.dispose();
}
Summary Zoom
A summary zoom provides an overview of presentation sections. During a slide show, you can use it to jump to a section, skip ahead, or revisit a topic without following the slide order.

For summary zoom objects, Aspose.Slides provides the ISummaryZoomFrame, ISummaryZoomSection, and ISummaryZoomSectionCollection interfaces and methods on the IShapeCollection interface.
Create a Summary Zoom
Use IShapeCollection.addSummaryZoomFrame to create an overview of the presentation’s sections. This example creates four sections with distinct slide backgrounds and adds a summary zoom to the first slide. The frame’s position and dimensions are specified in points, and the resulting overview is saved in a PPTX presentation.
import com.aspose.slides.*;
import android.graphics.Color;
Presentation presentation = new Presentation();
try {
ISlide overviewSlide = presentation.getSlides().get_Item(0);
ISlide slide = presentation.getSlides().addEmptySlide(overviewSlide.getLayoutSlide());
slide.getBackground().getFillFormat().setFillType(FillType.Solid);
slide.getBackground().getFillFormat().getSolidFillColor().setColor(Color.rgb(165, 42, 42));
slide.getBackground().setType(BackgroundType.OwnBackground);
presentation.getSections().addSection("Section 1", slide);
slide = presentation.getSlides().addEmptySlide(overviewSlide.getLayoutSlide());
slide.getBackground().getFillFormat().setFillType(FillType.Solid);
slide.getBackground().getFillFormat().getSolidFillColor().setColor(Color.CYAN);
slide.getBackground().setType(BackgroundType.OwnBackground);
presentation.getSections().addSection("Section 2", slide);
slide = presentation.getSlides().addEmptySlide(overviewSlide.getLayoutSlide());
slide.getBackground().getFillFormat().setFillType(FillType.Solid);
slide.getBackground().getFillFormat().getSolidFillColor().setColor(Color.rgb(127, 255, 0));
slide.getBackground().setType(BackgroundType.OwnBackground);
presentation.getSections().addSection("Section 3", slide);
slide = presentation.getSlides().addEmptySlide(overviewSlide.getLayoutSlide());
slide.getBackground().getFillFormat().setFillType(FillType.Solid);
slide.getBackground().getFillFormat().getSolidFillColor().setColor(Color.rgb(0, 100, 0));
slide.getBackground().setType(BackgroundType.OwnBackground);
presentation.getSections().addSection("Section 4", slide);
ISummaryZoomFrame summaryZoomFrame = overviewSlide.getShapes().addSummaryZoomFrame(150, 50, 300, 200);
presentation.save("presentation.pptx", SaveFormat.Pptx);
} finally {
presentation.dispose();
}
Add and Remove a Summary Zoom Section
A summary zoom stores its ISummaryZoomSection objects in ISummaryZoomFrame.getSummaryZoomCollection. This example creates an overview of two sections, adds a third section using ISummaryZoomSectionCollection.addSummaryZoomSection, and removes the first section’s entry using ISummaryZoomSectionCollection.removeSummaryZoomSection. Removing the entry leaves the presentation section and its slides intact.
import com.aspose.slides.*;
import android.graphics.Color;
Presentation presentation = new Presentation();
try {
ISlide overviewSlide = presentation.getSlides().get_Item(0);
ISlide slide = presentation.getSlides().addEmptySlide(overviewSlide.getLayoutSlide());
slide.getBackground().getFillFormat().setFillType(FillType.Solid);
slide.getBackground().getFillFormat().getSolidFillColor().setColor(Color.rgb(165, 42, 42));
slide.getBackground().setType(BackgroundType.OwnBackground);
ISection firstSection = presentation.getSections().addSection("Section 1", slide);
slide = presentation.getSlides().addEmptySlide(overviewSlide.getLayoutSlide());
slide.getBackground().getFillFormat().setFillType(FillType.Solid);
slide.getBackground().getFillFormat().getSolidFillColor().setColor(Color.CYAN);
slide.getBackground().setType(BackgroundType.OwnBackground);
presentation.getSections().addSection("Section 2", slide);
ISummaryZoomFrame summaryZoomFrame = overviewSlide.getShapes().addSummaryZoomFrame(150, 50, 300, 200);
slide = presentation.getSlides().addEmptySlide(overviewSlide.getLayoutSlide());
slide.getBackground().getFillFormat().setFillType(FillType.Solid);
slide.getBackground().getFillFormat().getSolidFillColor().setColor(Color.rgb(127, 255, 0));
slide.getBackground().setType(BackgroundType.OwnBackground);
ISection thirdSection = presentation.getSections().addSection("Section 3", slide);
summaryZoomFrame.getSummaryZoomCollection().addSummaryZoomSection(thirdSection);
summaryZoomFrame.getSummaryZoomCollection().removeSummaryZoomSection(firstSection);
presentation.save("presentation.pptx", SaveFormat.Pptx);
} finally {
presentation.dispose();
}
Format Summary Zoom Sections
This example formats the first entry in ISummaryZoomFrame.getSummaryZoomCollection, using the zero-based index 0. It requires a local image for IZoomObject.setZoomImage, applies a 1.5-point, dash-dot black border, and sets IZoomObject.setTransitionDuration to 1.5 seconds. Passing false to IZoomObject.setReturnToParent disables the automatic return to the summary slide for this entry.
import com.aspose.slides.*;
import android.graphics.Color;
Presentation presentation = new Presentation();
try {
ISlide overviewSlide = presentation.getSlides().get_Item(0);
ISlide slide = presentation.getSlides().addEmptySlide(overviewSlide.getLayoutSlide());
slide.getBackground().getFillFormat().setFillType(FillType.Solid);
slide.getBackground().getFillFormat().getSolidFillColor().setColor(Color.rgb(165, 42, 42));
slide.getBackground().setType(BackgroundType.OwnBackground);
presentation.getSections().addSection("Section 1", slide);
slide = presentation.getSlides().addEmptySlide(overviewSlide.getLayoutSlide());
slide.getBackground().getFillFormat().setFillType(FillType.Solid);
slide.getBackground().getFillFormat().getSolidFillColor().setColor(Color.CYAN);
slide.getBackground().setType(BackgroundType.OwnBackground);
presentation.getSections().addSection("Section 2", slide);
ISummaryZoomFrame summaryZoomFrame = overviewSlide.getShapes().addSummaryZoomFrame(150, 50, 300, 200);
ISummaryZoomSection summarySection = summaryZoomFrame.getSummaryZoomCollection().get_Item(0);
IPPImage previewImage;
IImage image = Images.fromFile("image.png");
try {
previewImage = presentation.getImages().addImage(image);
} finally {
image.dispose();
}
summarySection.setZoomImage(previewImage);
summarySection.setReturnToParent(false);
summarySection.getLineFormat().getFillFormat().setFillType(FillType.Solid);
summarySection.getLineFormat().getFillFormat().getSolidFillColor().setColor(Color.BLACK);
summarySection.getLineFormat().setDashStyle(LineDashStyle.DashDot);
summarySection.getLineFormat().setWidth(1.5f);
summarySection.setTransitionDuration(1.5f);
presentation.save("presentation.pptx", SaveFormat.Pptx);
} finally {
presentation.dispose();
}
FAQ
Can I control returning to the ‘parent’ slide after showing the target?
Yes. Call IZoomObject.setReturnToParent with true to return to the originating slide after the target content is shown.
Can I adjust the ‘speed’ or duration of the Zoom transition?
Yes. Use IZoomObject.setTransitionDuration to control the transition duration in seconds.
Are there limits on how many Zoom objects a presentation can contain?
There is no hard API limit documented. Practical limits depend on overall presentation complexity and the viewer’s performance. You can add many Zoom frames, but consider file size and rendering time.