TextFrame — Aspose.Slides FOSS for C++ API Reference
Properties TextFrame 类管理文本内容的 AutoShape 或表格 Cell.。它包含段落并提供直接的文本访问。.
Properties: Aspose::Slides::Foss
#include <Aspose/Slides/Foss/text_frame.h>class TextFrameProperties: include/Aspose/Slides/Foss/text_frame.h
Properties
| Properties | Properties | Properties |
|---|---|---|
text() | Properties | 返回所有段落的合并文本。. |
set_text(const std::string&) | Properties | 替换所有文本内容。. |
ITextFrame 接口
Properties ITextFrame 接口(来自 i_text_frame.h)定义::
| Properties | Properties |
|---|---|
text() | 获取文本内容。. |
set_text(const std::string&) | 设置文本内容。. |
ITextFrameFormat 接口
Properties ITextFrameFormat 接口控制文本框布局::
| Properties | Properties | Properties |
|---|---|---|
margin_left() / set_margin_left(double) | 读/写 | 左边距(单位:点)。. |
margin_right() / set_margin_right(double) | 读/写 | 右边距(单位:点)。. |
margin_top() / set_margin_top(double) | 读/写 | 上边距(单位:点)。. |
margin_bottom() / set_margin_bottom(double) | 读/写 | 底部边距(单位为点)。. |
wrap_text() / set_wrap_text(NullableBool) | 读/写 | 文本是否换行。. |
anchoring_type() / set_anchoring_type(TextAnchorType) | 读/写 | 垂直文本锚定。. |
center_text() / set_center_text(NullableBool) | 读/写 | 文本是否垂直居中。. |
使用示例
#include <Aspose/Slides/Foss/presentation.h>
using namespace Aspose::Slides::Foss;
Presentation prs("deck.pptx");
auto& shape = prs.slides()[0].shapes()[0];
// If shape is an AutoShape with a TextFrame:
// auto& tf = shape.text_frame();
// std::cout << tf.text() << std::endl;
// tf.set_text("Updated text");