ShapeCollection

ShapeCollection

Översikt

ShapeCollection är en klass i Aspose.Slides FOSS för C++.

Hantera samlingen av former på en slide. fungerar i två lägen: - Enkel mode (default): former hanteras endast i minnet. - XML-stödda lägen (efter init_internal): former laddas från och persistera till slidan spTree XML, med lazy caching.

Denna klass ger 49 metoder för att arbeta med ShapeCollection objekt i C++-program. Tillgängliga metoder inkluderar: ShapeCollection, Table, add_auto_shape, add_auto_shape_impl, add_connector, add_connector_impl, add_picture_frame, add_picture_frame_impl, add_table, add_table_impl, as_i_collection, as_i_enumerable,och 25 ytterligare metoder. Alla offentliga medlemmar är tillgängliga för alla C++-applikationer efter att ha installerat Aspose.Slides FOSS för C ++-paketet. och egenskaper: ShapeCollection, Table.

ägodelar

NamnTyp avAccessBeskrivning
ShapeCollectionShapeCollectionLäsningHämtar formsamlingen.
TableTableLäsningHämtar tabellen.

Metoder

SignatureBeskrivning
ShapeCollection()ShapeCollectionFastigheten ger tillgång till samlingen själv
Table()TableFastigheten ger tillgång till tabellformet som är associerat med samlingen.
Table()Table
ShapeCollection()
ShapeCollection()
init_internal(slide_part: Internal::pptx::SlidePart, parent_slide: IBaseSlide)Initialisera från en slidesida, genom att komma in i XML-stödda läge.
parent_group()IGroupShapeReturnerar föräldralagsformen, eller nullptr om toppnivå.
as_i_collection()IShapeCollectionÅterställer denna samling som ett generiskt samlingsgränssnitt.
as_i_enumerable()IShapeCollectionÅterställer denna samling som en generisk uppsummerbar gränssnitt.
size()std::size_tåterställer antalet former.
to_array()std::vector<Shape*>Returnerar alla former som icke-ägande indikatorer.
to_array(start_index: std::size_t, count: std::size_t)std::vector<Shape*>Returnerar alla former som icke-ägande indikatorer.
reorder(new_index: std::size_t, shape: Shape)Flytta en form till den angivna positionen (z-order).
reorder(index: std::size_t, shapes: std::span<Shape*>)Flytta en form till den angivna positionen (z-order).
add_auto_shape(type: ShapeType, x: double, y: double, width: double, height: double)AutoShapeLägg till en AutoShape i samlingen.
add_auto_shape(type: ShapeType, x: double, y: double, width: double, height: double, create_from_template: bool)AutoShapeLägg till en AutoShape i samlingen.
insert_auto_shape(index: std::size_t, type: ShapeType, x: double, y: double, width: double, height: double)AutoShapeAnge en AutoShape i den angivna indexet.
insert_auto_shape(index: std::size_t, type: ShapeType, x: double, y: double, width: double, height: double, create_from_template: bool)AutoShapeAnge en AutoShape i den angivna indexet.
add_connector(type: ShapeType, x: double, y: double, width: double, height: double)ConnectorLägg till en anslutning till samlingen.
add_connector(type: ShapeType, x: double, y: double, width: double, height: double, create_from_template: bool)ConnectorLägg till en anslutning till samlingen.
insert_connector(index: std::size_t, type: ShapeType, x: double, y: double, width: double, height: double)ConnectorAnge en anslutning på den angivna indexet.
insert_connector(index: std::size_t, type: ShapeType, x: double, y: double, width: double, height: double, create_from_template: bool)ConnectorAnge en anslutning på den angivna indexet.
index_of(shape: Shape)std::ptrdiff_tReturnerar nollbaserad index av en form, eller -1 om inte hittats.
add_picture_frame(type: ShapeType, x: double, y: double, width: double, height: double, image: PPImage)PictureFrameLägg till en PictureFrame i samlingen.
insert_picture_frame(index: std::size_t, type: ShapeType, x: double, y: double, width: double, height: double, image: PPImage)PictureFrameAnge en PictureFrame i den angivna indexet.
add_table(x: double, y: double, column_widths: std::span<const double>, row_heights: std::span<const double>)TableLägg till en tabell i samlingen.
insert_table(index: std::size_t, x: double, y: double, column_widths: std::span<const double>, row_heights: std::span<const double>)TableAnge en tabell på den angivna indexet.
remove(shape: Shape)Ta bort en form från samlingen genom referens.
remove_at(index: std::size_t)Ta bort formen på den angivna indexet.
clear()Ta bort alla former.
table_count()std::size_tÅterställ antalet tabeller i samlingen.
table_at(index: std::size_t)TableÅterställ tabellen till den angivna indexet.
table_at(index: std::size_t)TableÅterställ tabellen till den angivna indexet.
begin()iteratorReturnerar en iterator till den första formen
end()iteratorReturnerar en iterator över den sista formen
begin()const_iterator
end()const_iterator
get_sp_tree()pugi::xml_nodeHämta spTree‑elementet från bilden XML.
load_shapes()Ladda alla former från XML, populera den interna cache. No-op om cachen redan är giltig.
invalidate_cache()Invaliderar cache-formarna, tvingar en omlastning vid nästa åtkomst.
save_to_part()Spara ändringar i slide delen.
next_shape_id()intHitta nästa tillgängliga form ID i spTree.
build_auto_shape_xml(sp: pugi::xml_node, shape_id: int, name: std::string_view, type: ShapeType, x: double, y: double, w: double, h: double, create_from_template: bool)Bygg XML-innehåll för ett nytt AutoShape element.
build_connector_xml(cxn_sp: pugi::xml_node, shape_id: int, name: std::string_view, type: ShapeType, x: double, y: double, w: double, h: double, create_from_template: bool)Bygg XML-innehåll för ett nytt anslutningselement (cxnSp).
add_auto_shape_impl(index: std::optional<std::size_t>, type: ShapeType, x: double, y: double, w: double, h: double, create_from_template: bool)AutoShapeKernimplementation för add_auto_shape och insert_ auto_ shape.
add_connector_impl(index: std::optional<std::size_t>, type: ShapeType, x: double, y: double, w: double, h: double, create_from_template: bool)ConnectorKernimplementering för add_connector och insert_Connect.
add_picture_frame_impl(index: std::optional<std::size_t>, type: ShapeType, x: double, y: double, w: double, h: double, image: PPImage)PictureFrameKernimplementering för add_picture_frame och insert_icture-fram.
add_table_impl(index: std::optional<std::size_t>, x: double, y: double, column_widths: std::span<const double>, row_heights: std::span<const double>)TableKernimplementering för add_table och insert_tabell.
reorder_single(new_index: std::size_t, shape: Shape)Omför en enda form till en ny position i XML och cache.

Se även

 Svenska