AlignShapes

AlignShapes(ShapesAlignmentType, bool, IBaseSlide)

Modifie le placement de toutes les formes sur la diapositive. Aligne les formes aux marges ou au bord de la diapositive ou les aligne les unes par rapport aux autres.

public static void AlignShapes(ShapesAlignmentType alignmentType, bool alignToSlide, 
    IBaseSlide slide)
ParamètreTypeDescription
alignmentTypeShapesAlignmentTypeDétermine quel type d’alignement sera appliqué.
alignToSlideBooleanSi vrai, les formes seront alignées par rapport aux bords de la diapositive.
slideIBaseSlideDiapositive parente.

Exemples

Exemple:

[C#]
using (Presentation pres = new Presentation("pres.pptx"))
{
   SlideUtil.AlignShapes(ShapesAlignmentType.AlignBottom, true, pres.Slides);
}

Voir Aussi


AlignShapes(ShapesAlignmentType, bool, IBaseSlide, int[])

Modifie le placement des formes sélectionnées sur la diapositive. Aligne les formes aux marges ou au bord de la diapositive ou les aligne les unes par rapport aux autres.

public static void AlignShapes(ShapesAlignmentType alignmentType, bool alignToSlide, 
    IBaseSlide slide, int[] shapeIndexes)
ParamètreTypeDescription
alignmentTypeShapesAlignmentTypeDétermine quel type d’alignement sera appliqué.
alignToSlideBooleanSi vrai, les formes seront alignées par rapport aux bords de la diapositive.
slideIBaseSlideDiapositive parente.
shapeIndexesInt32[]Index des formes à aligner.

Exemples

Exemple:

[C#]
using (Presentation pres = new Presentation("pres.pptx"))
{
   ISlide slide = pres.Slides[0];
   IShape shape1 = slide.Shapes[0];
   IShape shape2 = slide.Shapes[1]; 

   SlideUtil.AlignShapes(ShapesAlignmentType.AlignBottom, false, pres.Slides[0], new int[]
   {
      slide.Shapes.IndexOf(shape1),
      slide.Shapes.IndexOf(shape2)
   });
}

Voir Aussi


AlignShapes(ShapesAlignmentType, bool, IGroupShape)

Modifie le placement de toutes les formes au sein d’un groupe de formes. Aligne les formes aux marges ou au bord de la diapositive ou les aligne les unes par rapport aux autres.

public static void AlignShapes(ShapesAlignmentType alignmentType, bool alignToSlide, 
    IGroupShape groupShape)
ParamètreTypeDescription
alignmentTypeShapesAlignmentTypeDétermine quel type d’alignement sera appliqué.
alignToSlideBooleanSi vrai, les formes seront alignées par rapport aux bords de la diapositive.
groupShapeIGroupShapeGroupe de formes parent.

Exemples

Exemple:

[C#]
using (Presentation pres = new Presentation("pres.pptx"))
{
   SlideUtil.AlignShapes(ShapesAlignmentType.AlignLeft, false, (GroupShape)slide.Shapes[0]);
}

Voir Aussi


AlignShapes(ShapesAlignmentType, bool, IGroupShape, int[])

Modifie le placement des formes sélectionnées au sein d’un groupe de formes. Aligne les formes aux marges ou au bord de la diapositive ou les aligne les unes par rapport aux autres.

public static void AlignShapes(ShapesAlignmentType alignmentType, bool alignToSlide, 
    IGroupShape groupShape, int[] shapeIndexes)
ParamètreTypeDescription
alignmentTypeShapesAlignmentTypeDétermine quel type d’alignement sera appliqué.
alignToSlideBooleanSi vrai, les formes seront alignées par rapport aux bords de la diapositive.
groupShapeIGroupShapeGroupe de formes parent.
shapeIndexesInt32[]Index des formes à aligner.

Exemples

Exemple:

[C#]
using (Presentation pres = new Presentation("pres.pptx"))
{
   SlideUtil.AlignShapes(ShapesAlignmentType.AlignLeft, false, (GroupShape)slide.Shapes[0], new int[] { 0, 2 });
}

Voir Aussi