עבודה עם Group Shapes ב Word מסמכים
לפעמים אתה צריך להוסיף group shape למסמך Word. group shape כזה מורכב ממספר צורות.
ב Microsoft Word, אתה יכול להוסיף במהירות group shape באמצעות הפקודה/לחצן הקבוצה. ניתן להעביר צורה בודדת בקבוצה בנפרד.
ב Aspose.Words קל מאוד להוסיף group shape באמצעות הכיתה GroupShape. הצורה נוצרת בנפרד באמצעות הכיתה Shape ואז מוסיפה לאובייקט GroupShape בשיטת AppendChild.
דוגמת הקוד הבאה מראה כיצד להוסיף group shape למסמך Word:
For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-C | |
// The path to the documents directory. | |
System::String outputDataDir = GetOutputDataDir_WorkingWithDocument(); | |
System::SharedPtr<Document> doc = System::MakeObject<Document>(); | |
doc->EnsureMinimum(); | |
System::SharedPtr<GroupShape> gs = System::MakeObject<GroupShape>(doc); | |
System::SharedPtr<Shape> shape = System::MakeObject<Shape>(doc, ShapeType::AccentBorderCallout1); | |
shape->set_Width(100); | |
shape->set_Height(100); | |
gs->AppendChild(shape); | |
System::SharedPtr<Shape> shape1 = System::MakeObject<Shape>(doc, ShapeType::ActionButtonBeginning); | |
shape1->set_Left(100); | |
shape1->set_Width(100); | |
shape1->set_Height(200); | |
gs->AppendChild(shape1); | |
gs->set_Width(200); | |
gs->set_Height(200); | |
gs->set_CoordSize(System::Drawing::Size(200, 200)); | |
System::SharedPtr<DocumentBuilder> builder = System::MakeObject<DocumentBuilder>(doc); | |
builder->InsertNode(gs); | |
System::String outputPath = outputDataDir + u"AddGroupShapeToDocument.doc"; | |
// Save the document to disk. | |
doc->Save(outputPath); |
להלן כמה מהסוגים Shape
הנתמכים ב Aspose.Words. לקבלת רשימה מלאה, בקר ShapeType:
- מלבן
- RoundRectangle
- RoundRectangle
- אליפסה
- יהלום
- משולש
- RightTriangle
- מקבילית
- טרפז
- שישה-צד
- אוקטגון