Questo breve tutorial descrive come unire forme in PowerPoint usando Java. You will learn how to set up the IDE, follow the programming instructions, and use the sample code to combine two shapes in PowerPoint with Java. We will also explain how to modify the sample code to generate the combined shapes you need in the output PPT or PPTX.
Steps to combine two shapes and create a new shape with Java.
- Configure the environment to use Aspose.Slides for Java to merge the shapes.
- Apply the product license, create an empty presentation and get its first slide.
- Add example shapes if no shape is available in the selected slide
- Calculate the smallest area that can contain both shapes.
- Add a new shape that fills that area to contain the combined shapes.
- Copy the outline of each original shape into the newly added shape, moving each outline so that it stays in the same place.
- Fill the united shape with a solid blue color, remove its border, and set a text label.
- Delete the original forms, as they have already been copied to the new location.
- Salva la presentazione come PPT o PPTX
Questi passaggi spiegano come unire forme su PowerPoint usando Java. Create an empty presentation or load the existing presentation, get the first slide, add sample shapes if there are no shapes present on the selected slide, calculate the bounding rectangle that can contain all the target shapes to be merged, and copy the outline of each original shape into the newly added shape following the offset. Fills the merged shape with a solid blue, removes its border, sets the text label, and deletes the original shapes from the resulting presentation.
Codice per combinare forme in PPT con Java
This code shows how to combine shapes in PowerPoint using Java. È possibile combinare i contorni in un unico percorso, così le forme si uniscono in un vero contorno invece di sovrapporsi. Enable or disable the border for each outline, so only the outer border of the combined shape displays a line.
Questo articolo spiega come unire le forme. Per disegnare le forme in PowerPoint, consulta l’articolo Disegnare forme in PowerPoint con Java.