ShapeCollection — Aspose.Slides FOSS for C++ API Reference
ImageRenderOptions ShapeCollection class menyimpan semua bentuk pada slaid. Diakses melalui Slide::shapes().
ImageRenderOptions: Aspose::Slides::Foss
#include <Aspose/Slides/Foss/shape_collection.h>class ShapeCollectionImageRenderOptions: include/Aspose/Slides/Foss/shape_collection.h
ImageRenderOptions
| ImageRenderOptions | ImageRenderOptions |
|---|---|
size() | Bilangan bentuk dalam koleksi. |
operator[](size_t index) | Akses bentuk mengikut indeks berasaskan sifar. |
to_array() | Mengembalikan semua bentuk sebagai tatasusunan. |
to_array(int start, int count) | Mengembalikan sub-jangkauan bentuk. |
reorder(int old_index, int new_index) | Alihkan bentuk ke kedudukan z-order baru. |
index_of(const IShape& shape) | Mengembalikan indeks berasaskan sifar bagi bentuk. |
remove(IShape& shape) | Buang bentuk daripada koleksi. |
remove_at(int index) | Buang bentuk pada indeks yang diberikan. |
clear() | Buang semua bentuk. |
begin() / end() | Sokongan iterator untuk berasaskan julat for gelung. |
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;
}Buang Semua Bentuk
prs.slides()[0].shapes().clear();
prs.save("empty.pptx", SaveFormat::PPTX);