ShapeCollection — Aspose.Slides FOSS for C++ API Reference

ImageRenderOptions ShapeCollection class saugo visas shapes skaidrėje. Prieinama per Slide::shapes().

ImageRenderOptions: Aspose::Slides::Foss

#include <Aspose/Slides/Foss/shape_collection.h>
class ShapeCollection

ImageRenderOptions: include/Aspose/Slides/Foss/shape_collection.h


ImageRenderOptions

ImageRenderOptionsImageRenderOptions
size()Formų skaičius kolekcijoje.
operator[](size_t index)Pasiekite shape pagal nulinį indeksą.
to_array()Grąžina visas shapes kaip masyvą.
to_array(int start, int count)Grąžina sub‑intervalą shapes.
reorder(int old_index, int new_index)Perkelkite shape į naują z‑order poziciją.
index_of(const IShape& shape)Grąžina nulinį shape indeksą.
remove(IShape& shape)Pašalinkite shape iš kolekcijos.
remove_at(int index)Pašalinkite shape nurodytame indekse.
clear()Pašalinkite visas shapes.
begin() / end()Iteratoriaus palaikymas intervalų pagrindu for ciklų.

Naudojimo pavyzdžiai

Iteruoti per formas

#include <Aspose/Slides/Foss/presentation.h>
using namespace Aspose::Slides::Foss;

Presentation prs("deck.pptx");
auto& shapes = prs.slides()[0].shapes();
for (size_t i = 0; i < shapes.size(); ++i) {
    auto& shape = shapes[i];
    std::cout << "Shape at (" << shape.x() << ", " << shape.y() << ")" << std::endl;
}

Pašalinti visas formas

prs.slides()[0].shapes().clear();
prs.save("empty.pptx", SaveFormat::PPTX);

Žr. taip pat

 Lietuvių