TextFrame — Aspose.Slides FOSS for C++ API Reference
Properties TextFrame class จัดการเนื้อหาข้อความของ 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");