TextFrame

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 TextFrame

Properties: include/Aspose/Slides/Foss/text_frame.h


Properties

PropertiesPropertiesProperties
text()Propertiesคืนข้อความที่ต่อเนื่องจากย่อหน้าทั้งหมด.
set_text(const std::string&)Propertiesแทนที่เนื้อหาข้อความทั้งหมด.

อินเทอร์เฟซ ITextFrame

Properties ITextFrame อินเทอร์เฟซ (จาก i_text_frame.h) กำหนด:

PropertiesProperties
text()รับเนื้อหาข้อความ.
set_text(const std::string&)ตั้งค่าเนื้อหาข้อความ.

อินเทอร์เฟซ ITextFrameFormat

Properties ITextFrameFormat อินเทอร์เฟซควบคุมการจัดวางกรอบข้อความ:

PropertiesPropertiesProperties
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");

ดูเพิ่มเติม

 ภาษาไทย