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

The Shape class is the base class for all visual elements on a slide. AutoShape extends Shape with geometry and an optional TextFrame.

Namespace: Aspose::Slides::Foss

#include <Aspose/Slides/Foss/shape.h>
#include <Aspose/Slides/Foss/auto_shape.h>

Headers: include/Aspose/Slides/Foss/shape.h, include/Aspose/Slides/Foss/auto_shape.h


Shape Properties

PropertyAccessorDescription
x() / set_x(float)Read/WriteX position in points.
y() / set_y(float)Read/WriteY position in points.
width() / set_width(float)Read/WriteWidth in points.
height() / set_height(float)Read/WriteHeight in points.
rotation() / set_rotation(float)Read/WriteRotation angle in degrees.
hidden() / set_hidden(bool)Read/WriteWhether the shape is hidden.
shape_type() / set_shape_type(ShapeType)Read/WriteThe geometry type of the shape.
z_order_position()ReadZ-order stacking position.
unique_id()ReadUnique identifier for this shape.
office_interop_shape_id()ReadOffice interop shape ID.
is_grouped()ReadWhether the shape belongs to a group.
is_text_holder()ReadWhether the shape can hold text.
is_decorative() / set_is_decorative(bool)Read/WriteWhether the shape is decorative (accessibility).
connection_site_count()ReadNumber of connection sites.
set_name(const std::string&)WriteSet the shape name.
set_alternative_text(const std::string&)WriteSet alt text for accessibility.
set_alternative_text_title(const std::string&)WriteSet alt text title.

Shape Format Properties

PropertyTypeDescription
fill_format()FillFormat&Fill settings for this shape.
line_format()LineFormat&Line/border settings.
effect_format()EffectFormat&Visual effect settings.
three_d_format()ThreeDFormat&3-D effect settings.
frame()ShapeFramePosition and size frame.

AutoShape

AutoShape inherits from GeometryShape (which inherits from Shape) and adds a TextFrame.

PropertyAccessorDescription
text_frame()ReadReturns the TextFrame for this auto shape.
geometry_shape()ReadReturns the geometry shape properties.

IShape Interface

The IShape interface defines the public contract. Key methods from IShape:

MethodDescription
set_raw_frame(const ShapeFrame&)Set the raw frame directly.
set_frame(const ShapeFrame&)Set the computed frame.

See Also