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

ImageRenderOptions ShapeCollection kelas menyimpan semua bentuk pada slide. Diakses melalui 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()Jumlah bentuk dalam koleksi.
operator[](size_t index)Akses bentuk dengan indeks berbasis nol.
to_array()Mengembalikan semua bentuk sebagai array.
to_array(int start, int count)Mengembalikan sub‑rentang bentuk.
reorder(int old_index, int new_index)Pindahkan bentuk ke posisi z-order baru.
index_of(const IShape& shape)Mengembalikan indeks berbasis nol dari sebuah bentuk.
remove(IShape& shape)Hapus sebuah bentuk dari koleksi.
remove_at(int index)Hapus bentuk pada indeks yang diberikan.
clear()Hapus semua bentuk.
begin() / end()Dukungan iterator untuk berbasis rentang for loop.

Contoh Penggunaan

Iterasi Bentuk

#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;
}

Hapus Semua Bentuk

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

Lihat Juga

 Bahasa Indonesia