AlignShapes()

SlideUtil::AlignShapes(ShapesAlignmentType, bool, System::SharedPtr<IBaseSlide>) method

Changes the placement of all shapes on the slide. Aligns shapes to the margins or the edge of the slide or align them relative to each other.

static void Aspose::Slides::Util::SlideUtil::AlignShapes(ShapesAlignmentType alignmentType, bool alignToSlide, System::SharedPtr<IBaseSlide> slide)

Arguments

ParameterTypeDescription
alignmentTypeShapesAlignmentTypeDetermines which type of alignment will be applied.
alignToSlideboolIf true, shapes will be aligned relative to the slide edges.
slideSystem::SharedPtr<IBaseSlide>Parent slide.

Remarks

Example:

System::SharedPtr<Presentation> pres = System::MakeObject<Presentation>(u"pres.pptx");

SlideUtil::AlignShapes(Aspose::Slides::ShapesAlignmentType::AlignBottom, true, pres->get_Slides()->idx_get(0));

SlideUtil::AlignShapes(ShapesAlignmentType, bool, System::SharedPtr<IBaseSlide>, System::ArrayPtr<int32_t>) method

Changes the placement of selected shapes on the slide. Aligns shapes to the margins or the edge of the slide or align them relative to each other.

static void Aspose::Slides::Util::SlideUtil::AlignShapes(ShapesAlignmentType alignmentType, bool alignToSlide, System::SharedPtr<IBaseSlide> slide, System::ArrayPtr<int32_t> shapeIndexes)

Arguments

ParameterTypeDescription
alignmentTypeShapesAlignmentTypeDetermines which type of alignment will be applied.
alignToSlideboolIf true, shapes will be aligned relative to the slide edges.
slideSystem::SharedPtr<IBaseSlide>Parent slide.
shapeIndexesSystem::ArrayPtr<int32_t>Indexes of shapes to be aligned.

Remarks

Example:

auto pres = System::MakeObject<Presentation>(u"pres.pptx");
auto slide = pres->get_Slides()->idx_get(0);
auto shape1 = slide->get_Shapes()->idx_get(0);
auto shape2 = slide->get_Shapes()->idx_get(1);
SlideUtil::AlignShapes(Aspose::Slides::ShapesAlignmentType::AlignBottom, false, pres->get_Slides()->idx_get(0),
    System::MakeArray<int32_t>({
        slide->get_Shapes()->IndexOf(shape1),
        slide->get_Shapes()->IndexOf(shape2)
    }));

SlideUtil::AlignShapes(ShapesAlignmentType, bool, System::SharedPtr<IGroupShape>) method

Changes the placement of all shapes within group shape. Aligns shapes to the margins or the edge of the slide or align them relative to each other.

static void Aspose::Slides::Util::SlideUtil::AlignShapes(ShapesAlignmentType alignmentType, bool alignToSlide, System::SharedPtr<IGroupShape> groupShape)

Arguments

ParameterTypeDescription
alignmentTypeShapesAlignmentTypeDetermines which type of alignment will be applied.
alignToSlideboolIf true, shapes will be aligned relative to the slide edges.
groupShapeSystem::SharedPtr<IGroupShape>Parent group shape.

Remarks

Example:

System::SharedPtr<Presentation> pres = System::MakeObject<Presentation>(u"pres.pptx");

SlideUtil::AlignShapes(Aspose::Slides::ShapesAlignmentType::AlignLeft, false, System::ExplicitCast<Aspose::Slides::GroupShape>(pres->get_Slides()->idx_get(0)->get_Shapes()));

SlideUtil::AlignShapes(ShapesAlignmentType, bool, System::SharedPtr<IGroupShape>, System::ArrayPtr<int32_t>) method

Changes the placement of selected shapes within group shape. Aligns shapes to the margins or the edge of the slide or align them relative to each other.

static void Aspose::Slides::Util::SlideUtil::AlignShapes(ShapesAlignmentType alignmentType, bool alignToSlide, System::SharedPtr<IGroupShape> groupShape, System::ArrayPtr<int32_t> shapeIndexes)

Arguments

ParameterTypeDescription
alignmentTypeShapesAlignmentTypeDetermines which type of alignment will be applied.
alignToSlideboolIf true, shapes will be aligned relative to the slide edges.
groupShapeSystem::SharedPtr<IGroupShape>Parent group shape.
shapeIndexesSystem::ArrayPtr<int32_t>Indexes of shapes to be aligned.

Remarks

Example:

System::SharedPtr<Presentation> pres = System::MakeObject<Presentation>(u"pres.pptx");

SlideUtil::AlignShapes(Aspose::Slides::ShapesAlignmentType::AlignLeft, false, System::ExplicitCast<Aspose::Slides::GroupShape>(pres->get_Slides()->idx_get(0)->get_Shapes()->idx_get(0)), System::MakeArray<int32_t>({0, 2}));

See Also