Unire forme in PowerPoint usando Python

Questa breve guida descrive come unire forme in PowerPoint usando Python. It covers the setup of an IDE, a list of programming steps, and sample code to combine two shapes in PowerPoint using Python. The guide also provides options to create a custom PPTX/PPT with a unified shape to meet your needs.

Passaggi per combinare forme in PPT con Python

  1. Configure the environment to use Aspose.Slides for Python via .NET to merge the shapes.
  2. Create a new presentation and open its default first slide.
  3. Add example shapes in the slide that overlap
  4. Calculate the dimensions of a box that encloses all the target shapes to be merged.
  5. Add a new shape similar in size to the box to contain all the shapes inside it.
  6. Copy the outline of each source shape and move it to its respective position within the new shape.
  7. Set the geometry of the new shape using the copied outlines together.
  8. Customize the combined shape by setting a solid color, removing its border, and adding a text label.
  9. Delete the original shapes from the slides and save the presentation.

Questi passaggi spiegano come combinare forme in PowerPoint usando Python. Crea una nuova presentazione, apri la prima diapositiva, aggiungi forme di esempio sovrapposte, calcola il riquadro di delimitazione attorno alle forme target, aggiungi una nuova forma con una dimensione simile al riquadro definito e copia il contorno di ogni forma sorgente all’interno della forma appena aggiunta. Combine the copied outlines to define the geometry of the new shape, set the properties of the combined shape as needed, and delete the original shapes before saving the presentation.

Code to combine two shapes to create a new shape using Python.

Questo codice dimostra come unire forme in PowerPoint usando Python. The geometry of a shape does not store its rotation, so if a shape is rotated, apply the rotation value to its path before merging. Use the visual bounds of the shapes instead of their bounding‑box size for a tighter bounding box, hide the internal outlines of the source shapes for better visibility, and keep the original style to preserve the appearance of the source shapes.

Questo articolo spiega come unire le forme. To draw various types of shapes, refer to the article Draw Shapes in PowerPoint using Python.

 Italiano