SmartArt
Contents
[
Hide
]
این مقاله نشان میدهد که چگونه میتوان گرافیکهای SmartArt را اضافه کرد، به آنها دسترسی یافت، آنها را حذف کرد و طرحبندیها را با استفاده از Aspose.Slides for C++ تغییر داد.
افزودن SmartArt
یک گرافیک SmartArt را با استفاده از یکی از طرحبندیهای پیشساخته وارد کنید.
static void AddSmartArt()
{
auto presentation = MakeObject<Presentation>();
auto slide = presentation->get_Slide(0);
auto smartArt = slide->get_Shapes()->AddSmartArt(50, 50, 400, 300, SmartArtLayoutType::BasicProcess);
presentation->Dispose();
}
دسترسی به SmartArt
اولین شیء SmartArt موجود در اسلاید را بازیابی کنید.
static void AccessSmartArt()
{
auto presentation = MakeObject<Presentation>();
auto slide = presentation->get_Slide(0);
auto smartArt = slide->get_Shapes()->AddSmartArt(50, 50, 400, 300, SmartArtLayoutType::BasicProcess);
auto firstSmartArt = SharedPtr<ISmartArt>();
for (auto&& shape : slide->get_Shapes())
{
if (ObjectExt::Is<ISmartArt>(shape))
{
firstSmartArt = ExplicitCast<ISmartArt>(shape);
break;
}
}
presentation->Dispose();
}
حذف SmartArt
یک شکل SmartArt را از اسلاید حذف کنید.
static void RemoveSmartArt()
{
auto presentation = MakeObject<Presentation>();
auto slide = presentation->get_Slide(0);
auto smartArt = slide->get_Shapes()->AddSmartArt(50, 50, 400, 300, SmartArtLayoutType::BasicProcess);
slide->get_Shapes()->Remove(smartArt);
presentation->Dispose();
}
تغییر طرحبندی SmartArt
نوع طرحبندی یک گرافیک SmartArt موجود را بهروز کنید.
static void ChangeSmartArtLayout()
{
auto presentation = MakeObject<Presentation>();
auto slide = presentation->get_Slide(0);
auto smartArt = slide->get_Shapes()->AddSmartArt(50, 50, 400, 300, SmartArtLayoutType::BasicBlockList);
smartArt->set_Layout(SmartArtLayoutType::VerticalPictureList);
presentation->Dispose();
}