Shape()

ForEach::Shape(System::SharedPtr<Presentation>, ForEach::ForEachShapeCallback) method

Iterate each ForEach::Shape in the Presentation.

static void Aspose::Slides::LowCode::ForEach::Shape(System::SharedPtr<Presentation> pres, ForEach::ForEachShapeCallback forEachShape)

Arguments

ParameterTypeDescription
presSystem::SharedPtr<Presentation>Presentation to iterate layout shapes
forEachShapeForEach::ForEachShapeCallbackCallback that will be invoked for each shape

Remarks

Shapes will be iterated in all type of slides - ForEach::Slide, ForEach::MasterSlide and ForEach::LayoutSlide

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

auto lambda = [](SharedPtr<Shape> shape, SharedPtr<BaseSlide> slide, int32_t index) -> void
{
    System::Console::WriteLine(u"{0}, index: {1}", shape->get_Name(), index);
};
auto callback = std::function<void(SharedPtr<Shape> shape, SharedPtr<BaseSlide> slide, int32_t index)>(lambda);

ForEach::Shape(pres, callback);

ForEach::Shape(System::SharedPtr<Presentation>, bool, ForEach::ForEachShapeCallback) method

Iterate each ForEach::Shape in the Presentation.

static void Aspose::Slides::LowCode::ForEach::Shape(System::SharedPtr<Presentation> pres, bool includeNotes, ForEach::ForEachShapeCallback forEachShape)

Arguments

ParameterTypeDescription
presSystem::SharedPtr<Presentation>Presentation to iterate layout shapes
includeNotesboolFlag that indicates whether NotesSlides should be included in processing.
forEachShapeForEach::ForEachShapeCallbackCallback that will be invoked for each shape

Remarks

Shapes will be iterated in all type of slides - ForEach::Slide, ForEach::MasterSlide, ForEach::LayoutSlide and NotesSlide if needed.

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

auto lambda = [](SharedPtr<Shape> shape, SharedPtr<BaseSlide> slide, int32_t index) -> void
{
    System::Console::WriteLine(u"{0}, index: {1}", shape->get_Name(), index);
};
auto callback = std::function<void(SharedPtr<Shape> shape, SharedPtr<BaseSlide> slide, int32_t index)>(lambda);

ForEach::Shape(pres, true, callback);

ForEach::Shape(System::SharedPtr<BaseSlide>, ForEach::ForEachShapeCallback) method

Iterate each ForEach::Shape in the BaseSlide.

static void Aspose::Slides::LowCode::ForEach::Shape(System::SharedPtr<BaseSlide> baseSlide, ForEach::ForEachShapeCallback forEachShape)

Arguments

ParameterTypeDescription
baseSlideSystem::SharedPtr<BaseSlide>Slide to iterate layout shapes
forEachShapeForEach::ForEachShapeCallbackCallback that will be invoked for each shape

Remarks

BaseSlide is the base type for ForEach::Slide, ForEach::MasterSlide and ForEach::LayoutSlide

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

ForEach::Slide(pres, std::function<void(SharedPtr<Slide> slide, int32_t index)>([](SharedPtr<Slide> slide, int32_t index)
{
    auto lambda = [](SharedPtr<Shape> shape, SharedPtr<BaseSlide> baseSlide, int32_t shapeIndex)
    {
        System::Console::WriteLine(u"{0}, index: {1}", shape->get_Name(), shapeIndex);
    };

    auto callback = std::function<void(SharedPtr<Shape> shape, SharedPtr<BaseSlide> baseSlide, int32_t shapeIndex)>(lambda);

    ForEach::Shape(slide, callback);
}));

See Also