Shape
Overview
Shape is a class in Aspose.Slides FOSS for C++.
Base class for all shapes on a slide.
This class provides 84 methods for working with Shape objects in C++ programs.
Available methods include: EffectFormat, FillFormat, IBaseSlide, IPresentation, IPresentationComponent, ISlideComponent, LineFormat, ShapeFrame, ShapeType, ThreeDFormat, alternative_text, alternative_text_title, and 57 additional methods.
All public members are accessible to any C++ application after installing the Aspose.Slides FOSS for C++ package.
Properties: EffectFormat, FillFormat, IBaseSlide, IPresentation, IPresentationComponent, ISlideComponent, and 4 more.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
ShapeType | ShapeType | Read | Gets the shape type. |
EffectFormat | EffectFormat | Read | Gets the effect format. |
FillFormat | FillFormat | Read | Gets the fill format. |
LineFormat | LineFormat | Read | Gets the line format. |
ThreeDFormat | ThreeDFormat | Read | Gets the three d format. |
ShapeFrame | ShapeFrame | Read | Gets the shape frame. |
ISlideComponent | ISlideComponent | Read | Gets the i slide component. |
IPresentation | IPresentation | Read | Gets the i presentation. |
IBaseSlide | IBaseSlide | Read | Gets the i base slide. |
IPresentationComponent | IPresentationComponent | Read | Gets the i presentation component. |
Methods
| Signature | Description |
|---|---|
ShapeType() → ShapeType | Property gets or sets the shape’s type |
EffectFormat() → EffectFormat | Property provides access to the shape’s effect formatting |
EffectFormat() → EffectFormat | |
FillFormat() → FillFormat | Returns the fill formatting object for the shape |
FillFormat() → FillFormat | |
LineFormat() → LineFormat | Property provides access to the shape’s line formatting |
LineFormat() → LineFormat | |
ThreeDFormat() → ThreeDFormat | Property provides access to the shape’s 3‑D formatting |
ThreeDFormat() → ThreeDFormat | |
ShapeFrame() → ShapeFrame | Property provides access to the shape’s frame data |
ShapeFrame() → ShapeFrame | |
ISlideComponent() → ISlideComponent | Returns the slide component interface implemented by the shape |
IPresentation() → IPresentation | Property references the presentation interface containing the shape |
IPresentation() → IPresentation | |
IBaseSlide() → IBaseSlide | Property references the base slide interface that holds the shape |
IBaseSlide() → IBaseSlide | |
IPresentationComponent() → IPresentationComponent | Returns the presentation component interface of the shape |
IPresentationComponent() → IPresentationComponent | |
~Shape() | |
shape_type() → ShapeType | Returns the shape type. |
set_shape_type(value: ShapeType) | Sets the shape type. |
x() → double | Returns the x-coordinate of the shape. |
set_x(value: double) | Sets the shape’s X coordinate |
y() → double | Returns the y-coordinate of the shape. |
set_y(value: double) | Sets the shape’s Y coordinate |
width() → double | Returns the width of the shape. |
set_width(value: double) | |
height() → double | Returns the height of the shape. |
set_height(value: double) | |
rotation() → double | Returns the rotation angle in degrees. |
set_rotation(value: double) | Sets the shape’s rotation angle |
name() → std::string | Returns the shape name. |
set_name(value: std::string) | |
effect_format() → EffectFormat | Returns the effect format for this shape. |
effect_format() → EffectFormat | Returns the effect format for this shape. |
fill_format() → FillFormat | Returns the fill format for this shape. |
fill_format() → FillFormat | Returns the fill format for this shape. |
line_format() → LineFormat | Returns the line format for this shape. |
line_format() → LineFormat | Returns the line format for this shape. |
three_d_format() → ThreeDFormat | Returns the 3D format for this shape. |
three_d_format() → ThreeDFormat | Returns the 3D format for this shape. |
is_text_holder() → bool | Determines whether the shape is a TextHolder. Default: false. |
placeholder() | Returns the placeholder. Default: nullptr. |
custom_data() | Returns the custom data. Default: nullptr. |
raw_frame() → ShapeFrame | Returns the raw shape frame. |
set_raw_frame(value: ShapeFrame) | |
frame() → ShapeFrame | Returns the shape frame. |
set_frame(value: ShapeFrame) | |
hidden() → bool | Determines whether the shape is hidden. |
set_hidden(value: bool) | |
z_order_position() → std::int32_t | Returns the z-order position. |
connection_site_count() → std::int32_t | Returns the number of connection sites (default 4). |
alternative_text() → std::string | Returns the alternative text. |
set_alternative_text(value: std::string) | |
alternative_text_title() → std::string | Returns the alternative text title. |
set_alternative_text_title(value: std::string) | |
is_decorative() → bool | Gets the ‘Mark as decorative’ option. |
set_is_decorative(value: bool) | |
unique_id() → std::uint32_t | Returns the presentation-scoped unique identifier. |
office_interop_shape_id() → std::uint32_t | Returns the slide-scoped shape identifier. |
is_grouped() → bool | Determines whether the shape is grouped. |
as_i_slide_component() → ISlideComponent | Returns the base ISlideComponent interface. |
presentation() → IPresentation | |
presentation() → IPresentation | |
slide() → IBaseSlide | |
slide() → IBaseSlide | |
as_i_presentation_component() → IPresentationComponent | |
as_i_presentation_component() → IPresentationComponent | |
set_z_order_position(value: std::int32_t) | Sets the z-order position (used internally by ShapeCollection). |
set_unique_id(value: std::uint32_t) | Sets the unique id (used internally). |
set_office_interop_shape_id(value: std::uint32_t) | Sets the office interop shape id (used internally). |
init_internal(xml_element: pugi::xml_node, slide_part: Internal::pptx::SlidePart, parent_slide: IBaseSlide) | Initialize this shape from an XML element within a slide part. |
build_frame() → ShapeFrame | Build a ShapeFrame from the current xfrm element. |
apply_frame(value: IShapeFrame) | Apply a ShapeFrame’s values to the xfrm element. |
get_sp_pr() → pugi::xml_node | Get the spPr (or grpSpPr) element for this shape. |
ensure_sp_pr() → pugi::xml_node | Get or create the spPr element. |
get_c_nv_pr() → pugi::xml_node | Get the cNvPr element from the shape XML. |
find_xfrm_in_element(xml_element: pugi::xml_node) → pugi::xml_node | Find the a:xfrm element directly within a shape XML element. |
get_placeholder_info() → std::optional<std::pair<std::optional<std::string>, std::string>> | |
find_placeholder_xfrm_in_xml(root: pugi::xml_node, ph_type: std::optional<std::string>, ph_idx: std::string_view) → pugi::xml_node | Find the xfrm for a matching placeholder in a layout/master XML root. |
xml_element() → pugi::xml_node | Returns the XML element backing this shape. |
get_inherited_xfrm() → pugi::xml_node | Walk the layout -> master chain to find inherited xfrm for placeholders. |
get_xfrm() → pugi::xml_node | Get the a:xfrm element from the shape XML, with placeholder inheritance. |
ensure_xfrm() → pugi::xml_node | Get or create the a:xfrm element. |