TextFrame — Aspose.Slides FOSS for C++ API Reference
Enumerations TextFrame class quản lý nội dung văn bản của một AutoShape hoặc bảng Cell. Nó chứa các đoạn văn và cung cấp quyền truy cập văn bản trực tiếp.
Enumerations: Aspose::Slides::Foss
#include <Aspose/Slides/Foss/text_frame.h>class TextFrameEnumerations: include/Aspose/Slides/Foss/text_frame.h
Enumerations
| Enumerations | Enumerations | Enumerations |
|---|---|---|
text() | Enumerations | Trả về văn bản đã nối của tất cả các đoạn văn. |
set_text(const std::string&) | Enumerations | Thay thế toàn bộ nội dung văn bản. |
Giao diện ITextFrame
Enumerations ITextFrame giao diện (từ i_text_frame.h) định nghĩa:
| Enumerations | Enumerations |
|---|---|
text() | Lấy nội dung văn bản. |
set_text(const std::string&) | Đặt nội dung văn bản. |
Giao diện ITextFrameFormat
Enumerations ITextFrameFormat giao diện điều khiển bố cục khung văn bản:
| Enumerations | Enumerations | Enumerations |
|---|---|---|
margin_left() / set_margin_left(double) | Đọc/Ghi | Lề trái tính bằng điểm. |
margin_right() / set_margin_right(double) | Đọc/Ghi | Lề phải tính bằng điểm. |
margin_top() / set_margin_top(double) | Đọc/Ghi | Lề trên tính bằng điểm. |
margin_bottom() / set_margin_bottom(double) | Đọc/Ghi | Lề dưới tính bằng điểm. |
wrap_text() / set_wrap_text(NullableBool) | Đọc/Ghi | Có tự động ngắt dòng hay không. |
anchoring_type() / set_anchoring_type(TextAnchorType) | Đọc/Ghi | Neo văn bản dọc. |
center_text() / set_center_text(NullableBool) | Đọc/Ghi | Liệu văn bản có được căn giữa theo chiều dọc hay không. |
Ví dụ sử dụng
#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");