توطين العرض
Contents
[
Hide
]
تغيير اللغة لنص العرض والشكل
- إنشاء نسخة من Presentation فئة.
- الحصول على مرجع لشريحة باستخدام فهرسها.
- إضافة AutoShape من نوع مستطيل إلى الشريحة.
- إضافة بعض النصوص إلى TextFrame.
- تعيين معرف اللغة للنص.
- كتابة العرض كملف PPTX.
تم توضيح تنفيذ الخطوات المذكورة أعلاه أدناه في مثال.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The path to the documents directory. | |
const String outPath = u"../out/TextBoxOnSlideProgram_out.pptx"; | |
const String templatePath = u"../templates/DefaultFonts_out.pptx"; | |
// Load the desired the presentation | |
SharedPtr<Presentation> pres = MakeObject<Presentation>(); | |
// Access first slide | |
SharedPtr<ISlide> sld = pres->get_Slides()->idx_get(0); | |
// Add an AutoShape of Rectangle type | |
SharedPtr<IAutoShape> ashp = sld->get_Shapes()->AddAutoShape(ShapeType::Rectangle, 150, 75, 150, 50); | |
// Add TextFrame to the Rectangle | |
ashp->AddTextFrame(u" "); | |
// Accessing the text frame | |
SharedPtr<ITextFrame> txtFrame = ashp->get_TextFrame(); | |
// Create the Paragraph object for text frame | |
SharedPtr<IParagraph> paragraph = txtFrame->get_Paragraphs()->idx_get(0); | |
// Create Portion object for paragraph | |
SharedPtr<IPortion> portion = paragraph->get_Portions()->idx_get(0); | |
portion->set_Text(u"Aspose TextBox"); | |
// Save PPTX to Disk | |
pres->Save(outPath, Aspose::Slides::Export::SaveFormat::Pptx); | |